Package de.xima.fc.workflow.converter
Class FlowchartModelConverter
- java.lang.Object
-
- de.xima.fc.workflow.converter.FlowchartModelConverter
-
public final class FlowchartModelConverter extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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 WorkflowProcess
toDataModel(FlowchartModel flowchartModel, Mandant client)
static WorkflowNode
toDataModel(NodeModel node, TaskModel task, Map<ElementKey,com.alibaba.fastjson.JSONObject> paramsMap, Mandant client)
static WorkflowProcess
toDataModel(ProcessModel process, Map<ElementKey,com.alibaba.fastjson.JSONObject> customParamsMap, Mandant client)
static WorkflowTask
toDataModel(TaskModel task, Map<ElementKey,com.alibaba.fastjson.JSONObject> paramsMap, Mandant client)
static WorkflowTrigger
toDataModel(TriggerModel trigger, TaskModel task, Map<ElementKey,com.alibaba.fastjson.JSONObject> paramsMap, Mandant client)
static WorkflowVersion
toVersion(IEntityContext ec, Mandant client, WorkflowVersion currentVersion, FlowchartModel flowchartModel, List<WorkflowStateModel> states)
static NodeModel
toViewModel(WorkflowNode node, WorkflowTask task, Map<ElementKey,com.alibaba.fastjson.JSONObject> paramsMap, Mandant client)
static ProcessModel
toViewModel(WorkflowProcess process, Map<ElementKey,com.alibaba.fastjson.JSONObject> paramsMap, Mandant client)
static TaskModel
toViewModel(WorkflowTask task, Map<ElementKey,com.alibaba.fastjson.JSONObject> paramsMap, Mandant client)
static TriggerModel
toViewModel(WorkflowTrigger trigger, WorkflowTask task, Map<ElementKey,com.alibaba.fastjson.JSONObject> paramsMap, Mandant client)
static NodeModel
toViewModel(INodePrototypeData<?> prototypeData, Map<UUID,com.alibaba.fastjson.JSONObject> paramsMap, Mandant client)
static TriggerModel
toViewModel(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 Detail
-
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)
-
-