Class RestVariableHelper

java.lang.Object
org.alfresco.rest.workflow.api.impl.RestVariableHelper

public class RestVariableHelper extends Object
Helper class for handling conversion between variable representations in rest and raw values used in the Activiti-engine.
Author:
Frederik Heremans
  • Field Details

    • INTERNAL_PROPERTIES

      public static final Set<String> INTERNAL_PROPERTIES
  • Constructor Details

    • RestVariableHelper

      public RestVariableHelper()
  • Method Details

    • setNodeService

      public void setNodeService(NodeService nodeService)
    • setNamespaceService

      public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
    • setDictionaryService

      public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
    • getQNameConverter

      protected WorkflowQNameConverter 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 - TypeDefinition
      taskTypeDefinition - 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 variables
      typeDefinition - 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 to TaskVariables 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 the TypeDefinition, 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

      protected Object getSafePropertyValue(Object value)
    • getRepresentationForNodeRef

      protected String getRepresentationForNodeRef(Object value, org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition)
    • extractTypeFromValue

      public org.alfresco.service.namespace.QName extractTypeFromValue(Object value)
    • extractTypeStringFromValue

      public String extractTypeStringFromValue(Object value)