Package de.xima.fc.workflow.converter
Class FlowchartModelConverter
java.lang.Object
de.xima.fc.workflow.converter.FlowchartModelConverter
Helper that converts between the domain model (
WorkflowNode, WorkflowTrigger, etc.) and the view
model for the flowchart component (NodeModel, TriggerModel, etc.)- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends IUuidProviding & IWorkflowElementTypeProviding>
ObjectdeserializeCustomProps(IElementWithTask<T> withTask, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static <T extends IUuidProviding & IWorkflowElementTypeProviding>
ObjectdeserializeCustomProps(ElementKey key, String type, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static <T extends IUuidProviding & IWorkflowElementTypeProviding>
ObjectdeserializeCustomProps(ElementKey key, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, IElementHandler<?, ?> handler) static <T extends IUuidProviding & IWorkflowElementTypeProviding>
ObjectdeserializeCustomProps(UUID taskUuid, T element, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static <T extends IUuidProviding & IWorkflowElementTypeProviding>
com.alibaba.fastjson.JSONObjectretrieveCustomParams(IElementWithTask<T> withTask, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static <T extends IUuidProviding & IWorkflowElementTypeProviding>
com.alibaba.fastjson.JSONObjectretrieveCustomParams(UUID taskUuid, T element, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static List<WorkflowState>toDataModel(IEntityContext ec, Mandant client, List<WorkflowStateModel> states) static WorkflowProcesstoDataModel(FlowchartModel flowchartModel, Mandant client) static WorkflowNodetoDataModel(NodeModel node, TaskModel task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static WorkflowProcesstoDataModel(ProcessModel process, Map<ElementKey, com.alibaba.fastjson.JSONObject> customParamsMap, Mandant client) static WorkflowTasktoDataModel(TaskModel task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static WorkflowTriggertoDataModel(TriggerModel trigger, TaskModel task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static WorkflowVersiontoVersion(IEntityContext ec, Mandant client, WorkflowVersion currentVersion, FlowchartModel flowchartModel, List<WorkflowStateModel> states) static NodeModeltoViewModel(WorkflowNode node, WorkflowTask task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static ProcessModeltoViewModel(WorkflowProcess process, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static TaskModeltoViewModel(WorkflowTask task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static TriggerModeltoViewModel(WorkflowTrigger trigger, WorkflowTask task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static NodeModeltoViewModel(INodePrototypeData<?> prototypeData, Map<UUID, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static TriggerModeltoViewModel(ITriggerPrototypeData<?> prototypeData, Map<UUID, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static <T extends IWorkflowElementTypeProviding & IUuidProviding>
voidupdateParams(Mandant client, ProcessModel process, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, BiFunction<Class<? extends IUUIDEntity>, UUID, UUID> updater) static <T extends IWorkflowElementTypeProviding & IUuidProviding>
voidupdateParams(Mandant client, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, UUID taskUuid, T element, BiFunction<Class<? extends IUUIDEntity>, UUID, UUID> updater)
-
Method Details
-
deserializeCustomProps
public static <T extends IUuidProviding & IWorkflowElementTypeProviding> Object deserializeCustomProps(IElementWithTask<T> withTask, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
deserializeCustomProps
public static <T extends IUuidProviding & IWorkflowElementTypeProviding> Object deserializeCustomProps(UUID taskUuid, T element, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
deserializeCustomProps
public static <T extends IUuidProviding & IWorkflowElementTypeProviding> Object deserializeCustomProps(ElementKey key, String type, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
deserializeCustomProps
public static <T extends IUuidProviding & IWorkflowElementTypeProviding> Object deserializeCustomProps(ElementKey key, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, IElementHandler<?, ?> handler) -
retrieveCustomParams
public static <T extends IUuidProviding & IWorkflowElementTypeProviding> com.alibaba.fastjson.JSONObject retrieveCustomParams(IElementWithTask<T> withTask, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
retrieveCustomParams
public static <T extends IUuidProviding & IWorkflowElementTypeProviding> com.alibaba.fastjson.JSONObject retrieveCustomParams(UUID taskUuid, T element, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
toDataModel
public static WorkflowProcess toDataModel(FlowchartModel flowchartModel, Mandant client) throws FastJsonException - Throws:
FastJsonException
-
toDataModel
public static WorkflowNode toDataModel(NodeModel node, TaskModel task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
toDataModel
public static WorkflowProcess toDataModel(ProcessModel process, Map<ElementKey, com.alibaba.fastjson.JSONObject> customParamsMap, Mandant client) -
toDataModel
public static WorkflowTask toDataModel(TaskModel task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
toDataModel
public static WorkflowTrigger toDataModel(TriggerModel trigger, TaskModel task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
toViewModel
public static NodeModel toViewModel(INodePrototypeData<?> prototypeData, Map<UUID, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) throws FastJsonException- Parameters:
prototypeData- Prototype data to convert to a node model.paramsMap- Custom node parameters map that is filled with the prototype data.client- Client scope for locating node plugins.- Returns:
- The node model for the given node prototype.
- Throws:
FastJsonException- When the data could not be converted to JSON.
-
toViewModel
public static TriggerModel toViewModel(ITriggerPrototypeData<?> prototypeData, Map<UUID, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) throws FastJsonException- Parameters:
prototypeData- Prototype data to convert to a trigger model.paramsMap- Custom trigger parameters map that is filled with the prototype data.client- Client scope for locating trigger plugins.- Returns:
- The node model for the given trigger prototype.
- Throws:
FastJsonException- When the data could not be converted to JSON.
-
toViewModel
public static NodeModel toViewModel(WorkflowNode node, WorkflowTask task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
toViewModel
public static ProcessModel toViewModel(WorkflowProcess process, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
toViewModel
public static TaskModel toViewModel(WorkflowTask task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
toViewModel
public static TriggerModel toViewModel(WorkflowTrigger trigger, WorkflowTask task, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) -
toDataModel
public static List<WorkflowState> toDataModel(IEntityContext ec, Mandant client, List<WorkflowStateModel> states) -
toVersion
public static WorkflowVersion toVersion(IEntityContext ec, Mandant client, WorkflowVersion currentVersion, FlowchartModel flowchartModel, List<WorkflowStateModel> states) throws FastJsonException - Throws:
FastJsonException
-
updateParams
public static <T extends IWorkflowElementTypeProviding & IUuidProviding> void updateParams(Mandant client, ProcessModel process, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, BiFunction<Class<? extends IUUIDEntity>, UUID, UUID> updater) -
updateParams
public static <T extends IWorkflowElementTypeProviding & IUuidProviding> void updateParams(Mandant client, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, UUID taskUuid, T element, BiFunction<Class<? extends IUUIDEntity>, UUID, UUID> updater)
-