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_KEYS
protected static String
EXPRESSION_VARIABLE_DELIMITER
protected static String
FE_EXPRESSION_END
protected static String
FE_EXPRESSION_START
protected static String
FLOWABLE_DATA_OBJECT_VARIABLE_TYPE
protected static String
FLOWABLE_DETACHED_DATA_OBJECT_VARIABLE_TYPE
protected static String
FLOWABLE_VARIABLE_TYPE_KEY
protected 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 boolean
areValuesEqual(Object variableValue, Object originalValue)
protected static Object
convertToContentItem(Object value, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
protected static String
createBEExpression(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 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)
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 String
getStartFormKey(Map<String,List<ExtensionElement>> extensionElements)
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 listprotected static boolean
isListOfType(Object value, Class<?> listElementClass)
static boolean
isStartFormSameDeployment(Map<String,List<ExtensionElement>> extensionElements)
protected static void
parseChildFormVariableList(List<Object> variableList, List<String> parentVariableList, Map<String,Object> originalPayload, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
protected static void
parseChildFormVariableMap(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 boolean
skipVariable(int childIndex, Object variableValue, List<Map<String,Object>> originalListPayload)
protected static boolean
skipVariable(String variableName, Object variableValue, Map<String,Object> originalPayload)
protected static boolean
skipVariable(String variableName, String childName, Object variableValue, Map<String,Object> originalPayload)
protected static boolean
skipVariable(List<String> parentVariableNames, String childName, Object variableValue, Map<String,Object> originalPayload)
protected static Boolean
transformAsBoolean(Object value)
protected static Object
transformAsDate(Object value)
protected static Number
transformAsNumber(Object value, String subType)
protected static Object
transformAsPotentialJsonNode(Object value, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
protected static Object
transformVariable(Object submittedValue, List<FormVariable> variableTypes, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
protected static void
traverseVariableListForContentItems(List<Map<String,Object>> valuesList, Set<String> contentItemIdSet, Map<String,Map<String,Object>> metadataMap)
protected static void
traverseVariableMapForContentItems(Map<String,Object> mapValue, Set<String> contentItemIdSet, Map<String,Map<String,Object>> metadataMap)
protected static boolean
treatValueAsDataObject(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
-
-