Class FormPayloadHelper
- java.lang.Object
-
- com.flowable.platform.common.form.FormPayloadHelper
-
public class FormPayloadHelper extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static Set<String>BASE_EXPRESSION_KEYSprotected static StringEXPRESSION_VARIABLE_DELIMITERprotected static StringFE_EXPRESSION_ENDprotected static StringFE_EXPRESSION_STARTprotected static StringFLOWABLE_DATA_OBJECT_VARIABLE_TYPEprotected static StringFLOWABLE_DETACHED_DATA_OBJECT_VARIABLE_TYPEprotected static StringFLOWABLE_VARIABLE_TYPE_KEYprotected static Collection<String>PRIORITIZED_VARIABLE_TYPES
-
Constructor Summary
Constructors Constructor Description FormPayloadHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static booleanareValuesEqual(Object variableValue, Object originalValue)protected static ObjectconvertToContentItem(Object value, com.fasterxml.jackson.databind.ObjectMapper objectMapper)protected static StringcreateBEExpression(String... variableNameParts)protected static List<Object>getFormDataModelListVariable(String submittedKey, FormDataModel formDataModel, List<Map<String,Object>> variables, Map<String,Object> originalPayload, Map<String,List<FormVariable>> variableTypes, com.fasterxml.jackson.databind.ObjectMapper objectMapper, List<FormVariable> dataModelVariableTypes)protected static ObjectgetFormDataModelVariable(String submittedKey, FormDataModel formDataModel, Map<String,Object> dataModelValues, Map<String,Object> originalDataModelValues, Map<String,List<FormVariable>> variableTypes, com.fasterxml.jackson.databind.ObjectMapper objectMapper, List<FormVariable> dataModelVariableTypes)protected static List<FormVariable>getFormVariables(String submittedKey, String childKey, Map<String,List<FormVariable>> variableTypes)static Map<String,List<ExtensionElement>>getPlanItemExtensionElements(String caseDefinitionId, String planItemDefinitionId)static StringgetStartFormKey(Map<String,List<ExtensionElement>> extensionElements)protected static FormVariablegetVariableToApply(List<FormVariable> variableTypes)Get the first prioritized variable type from the variableTypes if exists, or the first variable type from the listprotected static booleanisListOfType(Object value, Class<?> listElementClass)static booleanisStartFormSameDeployment(Map<String,List<ExtensionElement>> extensionElements)protected static voidparseChildFormVariableList(List<Object> variableList, List<String> parentVariableList, Map<String,Object> originalPayload, com.fasterxml.jackson.databind.ObjectMapper objectMapper)protected static voidparseChildFormVariableMap(Map<String,Object> variableMap, List<String> parentVariableList, Map<String,Object> originalPayload, com.fasterxml.jackson.databind.ObjectMapper objectMapper)static Map<String,Object>parseFormVariables(Map<String,Object> submittedValues, Map<String,Object> originalPayload, FlowableFormModel formModel, com.fasterxml.jackson.databind.ObjectMapper objectMapper)protected static List<ContentItem>retrieveContentItems(CoreContentService contentService, Set<String> contentItemIdSet, Map<String,Map<String,Object>> metadataMap)protected static booleanskipVariable(int childIndex, Object variableValue, List<Map<String,Object>> originalListPayload)protected static booleanskipVariable(String variableName, Object variableValue, Map<String,Object> originalPayload)protected static booleanskipVariable(String variableName, String childName, Object variableValue, Map<String,Object> originalPayload)protected static booleanskipVariable(List<String> parentVariableNames, String childName, Object variableValue, Map<String,Object> originalPayload)protected static BooleantransformAsBoolean(Object value)protected static ObjecttransformAsDate(Object value)protected static NumbertransformAsNumber(Object value, String subType)protected static ObjecttransformAsPotentialJsonNode(Object value, com.fasterxml.jackson.databind.ObjectMapper objectMapper)protected static ObjecttransformVariable(Object submittedValue, List<FormVariable> variableTypes, com.fasterxml.jackson.databind.ObjectMapper objectMapper)protected static voidtraverseVariableListForContentItems(List<Map<String,Object>> valuesList, Set<String> contentItemIdSet, Map<String,Map<String,Object>> metadataMap)protected static voidtraverseVariableMapForContentItems(Map<String,Object> mapValue, Set<String> contentItemIdSet, Map<String,Map<String,Object>> metadataMap)protected static booleantreatValueAsDataObject(Map<?,?> value, FormDataModel formDataModel)static Map<String,Object>validatePayload(Map<String,Object> submittedValues, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
-
Field Detail
-
FE_EXPRESSION_END
protected static final String FE_EXPRESSION_END
- See Also:
- Constant Field Values
-
FE_EXPRESSION_START
protected static final String FE_EXPRESSION_START
- See Also:
- Constant Field Values
-
EXPRESSION_VARIABLE_DELIMITER
protected static final String EXPRESSION_VARIABLE_DELIMITER
- See Also:
- Constant Field Values
-
PRIORITIZED_VARIABLE_TYPES
protected static final Collection<String> PRIORITIZED_VARIABLE_TYPES
-
FLOWABLE_VARIABLE_TYPE_KEY
protected static final String FLOWABLE_VARIABLE_TYPE_KEY
- See Also:
- Constant Field Values
-
FLOWABLE_DATA_OBJECT_VARIABLE_TYPE
protected static final String FLOWABLE_DATA_OBJECT_VARIABLE_TYPE
- See Also:
- Constant Field Values
-
FLOWABLE_DETACHED_DATA_OBJECT_VARIABLE_TYPE
protected static final String FLOWABLE_DETACHED_DATA_OBJECT_VARIABLE_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
validatePayload
public static Map<String,Object> validatePayload(Map<String,Object> submittedValues, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
parseFormVariables
public static Map<String,Object> parseFormVariables(Map<String,Object> submittedValues, Map<String,Object> originalPayload, FlowableFormModel formModel, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
treatValueAsDataObject
protected static boolean treatValueAsDataObject(Map<?,?> value, FormDataModel formDataModel)
-
parseChildFormVariableMap
protected static void parseChildFormVariableMap(Map<String,Object> variableMap, List<String> parentVariableList, Map<String,Object> originalPayload, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
parseChildFormVariableList
protected static void parseChildFormVariableList(List<Object> variableList, List<String> parentVariableList, Map<String,Object> originalPayload, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
getFormDataModelListVariable
protected static List<Object> getFormDataModelListVariable(String submittedKey, FormDataModel formDataModel, List<Map<String,Object>> variables, Map<String,Object> originalPayload, Map<String,List<FormVariable>> variableTypes, com.fasterxml.jackson.databind.ObjectMapper objectMapper, List<FormVariable> dataModelVariableTypes)
-
getFormDataModelVariable
protected static Object getFormDataModelVariable(String submittedKey, FormDataModel formDataModel, Map<String,Object> dataModelValues, Map<String,Object> originalDataModelValues, Map<String,List<FormVariable>> variableTypes, com.fasterxml.jackson.databind.ObjectMapper objectMapper, List<FormVariable> dataModelVariableTypes)
-
getPlanItemExtensionElements
public static Map<String,List<ExtensionElement>> getPlanItemExtensionElements(String caseDefinitionId, String planItemDefinitionId)
-
getStartFormKey
public static String getStartFormKey(Map<String,List<ExtensionElement>> extensionElements)
-
isStartFormSameDeployment
public static boolean isStartFormSameDeployment(Map<String,List<ExtensionElement>> extensionElements)
-
convertToContentItem
protected static Object convertToContentItem(Object value, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
traverseVariableListForContentItems
protected static void traverseVariableListForContentItems(List<Map<String,Object>> valuesList, Set<String> contentItemIdSet, Map<String,Map<String,Object>> metadataMap)
-
traverseVariableMapForContentItems
protected static void traverseVariableMapForContentItems(Map<String,Object> mapValue, Set<String> contentItemIdSet, Map<String,Map<String,Object>> metadataMap)
-
retrieveContentItems
protected static List<ContentItem> retrieveContentItems(CoreContentService contentService, Set<String> contentItemIdSet, Map<String,Map<String,Object>> metadataMap)
-
skipVariable
protected static boolean skipVariable(String variableName, Object variableValue, Map<String,Object> originalPayload)
-
skipVariable
protected static boolean skipVariable(String variableName, String childName, Object variableValue, Map<String,Object> originalPayload)
-
skipVariable
protected static boolean skipVariable(List<String> parentVariableNames, String childName, Object variableValue, Map<String,Object> originalPayload)
-
skipVariable
protected static boolean skipVariable(int childIndex, Object variableValue, List<Map<String,Object>> originalListPayload)
-
getFormVariables
protected static List<FormVariable> getFormVariables(String submittedKey, String childKey, Map<String,List<FormVariable>> variableTypes)
-
transformVariable
protected static Object transformVariable(Object submittedValue, List<FormVariable> variableTypes, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
transformAsPotentialJsonNode
protected static Object transformAsPotentialJsonNode(Object value, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
getVariableToApply
protected static FormVariable getVariableToApply(List<FormVariable> variableTypes)
Get the first prioritized variable type from the variableTypes if exists, or the first variable type from the list- Parameters:
variableTypes- list of variables- Returns:
- variable which is applied on the value
-
-