mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9727: Querying using NodeRef type now uses ActivitiScriptNodeVariableType insead of ByteArrayVariableType (which isn't queryable) + fixed activiti components text-context
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30848 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -585,6 +585,40 @@ public class ActivitiPropertyConverter
|
||||
throw new WorkflowException(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs basic conversion from a property to a
|
||||
* value that can be uses as activiti variable. If the type of the
|
||||
* property is known, use {@link #convertValueToPropertyType(Task, Serializable, QName)}
|
||||
*
|
||||
* @param property the property to be converted
|
||||
*
|
||||
* @return the value
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public Object convertPropertyToValue(Object property) {
|
||||
if(property instanceof NodeRef) {
|
||||
return nodeConverter.convertNode((NodeRef) property);
|
||||
} else if(property instanceof Collection) {
|
||||
boolean allNodes = true;
|
||||
// Check if collection contains node-refs
|
||||
for(Object item : ((Collection)property)) {
|
||||
if(!(item instanceof NodeRef)) {
|
||||
allNodes = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(allNodes) {
|
||||
return nodeConverter.convertNodes((Collection<NodeRef>) property);
|
||||
} else {
|
||||
return property;
|
||||
}
|
||||
} else {
|
||||
// No conversion needed, property can be used.
|
||||
return property;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a {@link Serializable} value to the type of the specified property.
|
||||
* @param value
|
||||
|
Reference in New Issue
Block a user