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(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(T element, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Mandant client) static <T extends IUuidProviding & IWorkflowElementTypeProviding>
com.alibaba.fastjson.JSONObjectretrieveCustomParams(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, 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, 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, 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, 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 voidupdateParams(Mandant client, ProcessModel process, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Function<IObjectReference, String> updater) static <T extends IWorkflowElementTypeProviding & IUuidProviding>
voidupdateParams(Mandant client, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, T element, Function<IObjectReference, String> updater)
-
Method Details
-
deserializeCustomProps
public static <T extends IUuidProviding & IWorkflowElementTypeProviding> Object deserializeCustomProps(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(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, 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, 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, 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, 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 void updateParams(Mandant client, ProcessModel process, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, Function<IObjectReference, String> updater) -
updateParams
public static <T extends IWorkflowElementTypeProviding & IUuidProviding> void updateParams(Mandant client, Map<ElementKey, com.alibaba.fastjson.JSONObject> paramsMap, T element, Function<IObjectReference, String> updater)
-