Class RestVariableHelper
java.lang.Object
org.alfresco.rest.workflow.api.impl.RestVariableHelper
Helper class for handling conversion between variable representations in rest and raw values used in the Activiti-engine.
- Author:
- Frederik Heremans
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTaskVariables(List<TaskVariable> result, Map<String, Object> variables, TypeDefinitionContext context, VariableScope scope) Converts the raw variables toTaskVariables and adds them to the given result-list.org.alfresco.service.namespace.QNameextractTypeFromValue(Object value) extractTypeStringFromValue(Object value) protected ObjectgetAssociationRepresentation(Object value, org.alfresco.service.cmr.dictionary.AssociationDefinition assocDef) protected WorkflowQNameConverterprotected StringgetRepresentationForNodeRef(Object value, org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition) protected ObjectgetSafePropertyValue(Object value) getTaskVariables(Map<String, Object> localVariables, Map<String, Object> globalVariables, org.alfresco.service.cmr.dictionary.TypeDefinition startFormTypeDefinition, org.alfresco.service.cmr.dictionary.TypeDefinition taskTypeDefinition) getVariables(Map<String, Object> variables, org.alfresco.service.cmr.dictionary.TypeDefinition typeDefinition) voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) voidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) voidsetNodeService(NodeService nodeService) protected voidsetVariableValueAndType(Variable variable, Object value, TypeDefinitionContext context) Sets the variable value with possible conversion to the correct format to be used in the response and sets the type accordingly.
-
Field Details
-
INTERNAL_PROPERTIES
-
-
Constructor Details
-
RestVariableHelper
public RestVariableHelper()
-
-
Method Details
-
setNodeService
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) -
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) -
getQNameConverter
-
getTaskVariables
public List<TaskVariable> getTaskVariables(Map<String, Object> localVariables, Map<String, Object> globalVariables, org.alfresco.service.cmr.dictionary.TypeDefinition startFormTypeDefinition, org.alfresco.service.cmr.dictionary.TypeDefinition taskTypeDefinition) - Parameters:
localVariables- raw local task variables, can be null.globalVariables- raw global taks variables, can be null.startFormTypeDefinition- TypeDefinitiontaskTypeDefinition- the typê definition for this task, used to extract types.- Returns:
- list of
TaskVariable, representing the given raw variables
-
getVariables
public List<Variable> getVariables(Map<String, Object> variables, org.alfresco.service.cmr.dictionary.TypeDefinition typeDefinition) - Parameters:
variables- raw variablestypeDefinition- the typê definition for the start-task of the process, used to extract types.- Returns:
- list of
Variable, representing the given raw variables
-
addTaskVariables
public void addTaskVariables(List<TaskVariable> result, Map<String, Object> variables, TypeDefinitionContext context, VariableScope scope) Converts the raw variables toTaskVariables and adds them to the given result-list. -
setVariableValueAndType
protected void setVariableValueAndType(Variable variable, Object value, TypeDefinitionContext context) Sets the variable value with possible conversion to the correct format to be used in the response and sets the type accordingly. If the variables is defined on theTypeDefinition, the data-type is used. If it's not defined, the type is deducted from the raw variable value. -
getAssociationRepresentation
protected Object getAssociationRepresentation(Object value, org.alfresco.service.cmr.dictionary.AssociationDefinition assocDef) - Returns:
- object that represents the association value.
-
getSafePropertyValue
-
getRepresentationForNodeRef
-
extractTypeFromValue
-
extractTypeStringFromValue
-