mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
OPEN : ALF-10043: WorkflowServiceImpl incorrectly handles "reassignable" property
jbpm creates booleans as Strings "T" or "F", this attempts to convert them to booleans for use in Alfresco. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32802 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -88,6 +88,7 @@ import org.jbpm.JbpmException;
|
|||||||
import org.jbpm.context.exe.ContextInstance;
|
import org.jbpm.context.exe.ContextInstance;
|
||||||
import org.jbpm.context.exe.TokenVariableMap;
|
import org.jbpm.context.exe.TokenVariableMap;
|
||||||
import org.jbpm.context.exe.VariableInstance;
|
import org.jbpm.context.exe.VariableInstance;
|
||||||
|
import org.jbpm.context.exe.converter.BooleanToStringConverter;
|
||||||
import org.jbpm.db.GraphSession;
|
import org.jbpm.db.GraphSession;
|
||||||
import org.jbpm.db.TaskMgmtSession;
|
import org.jbpm.db.TaskMgmtSession;
|
||||||
import org.jbpm.file.def.FileDefinition;
|
import org.jbpm.file.def.FileDefinition;
|
||||||
@@ -2477,7 +2478,7 @@ public class JBPMEngine extends AlfrescoBpmEngine implements WorkflowEngine
|
|||||||
boolean isAssoc = taskAssocs.containsKey(qname);
|
boolean isAssoc = taskAssocs.containsKey(qname);
|
||||||
if (taskProperties.containsKey(qname) || isAssoc || instance.hasVariableLocally(key))
|
if (taskProperties.containsKey(qname) || isAssoc || instance.hasVariableLocally(key))
|
||||||
{
|
{
|
||||||
Serializable value = convertValue(entry.getValue());
|
Serializable value = convertValue(taskProperties.get(qname), entry.getValue());
|
||||||
properties.put(qname, value);
|
properties.put(qname, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2908,7 +2909,25 @@ public class JBPMEngine extends AlfrescoBpmEngine implements WorkflowEngine
|
|||||||
|
|
||||||
return (missingProps == null) ? null : missingProps.toArray(new QName[missingProps.size()]);
|
return (missingProps == null) ? null : missingProps.toArray(new QName[missingProps.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to convert a JBPM Object to the correct Alfresco data type
|
||||||
|
* @param propDef PropertyDefinition
|
||||||
|
* @param value any Value
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Serializable convertValue(PropertyDefinition propDef, Object value)
|
||||||
|
{
|
||||||
|
if (propDef != null && value instanceof String && Boolean.class.getName().equals(propDef.getDataType().getJavaClassName()))
|
||||||
|
{
|
||||||
|
return (Serializable) new BooleanToStringConverter().revert(value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return convertValue(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a jBPM Value to an Alfresco value
|
* Convert a jBPM Value to an Alfresco value
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user