Class ElementPropertiesHelper
java.lang.Object
de.xima.fc.workflow.designer.helper.ElementPropertiesHelper
Static methods for the
NodePropertiesBean
and TriggerPropertiesBean
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionstatic <TData> CheckForUnsavedChangedResult<WorkflowNode>
checkForUnsavedChanges
(IEntityContext ec, long processId, UUID taskUuid, UUID elementUuid, TData data, INodeHandler<TData> handler) static <TData> CheckForUnsavedChangedResult<WorkflowTrigger>
checkForUnsavedChanges
(IEntityContext ec, long processId, UUID taskUuid, UUID elementUuid, TData data, ITriggerHandler<TData> handler) static FlowchartSelection<?>
findElementFuzzy
(AssociatesModel associatesModel, FlowchartModel flowchartModel, PropertiesPanelModel propertiesPanelModel) Attempts to find the workflow element (node or trigger) indicated by the currentPropertiesPanelModel.getSelection()
.static String
getLabelOfSelectedElement
(IBaseWorkflowEnvironmentData env, WorkflowModelBean modelBean, IWorkflowProvider provider) Finds the label of the currently selected element.static LoadPropsRetVal<NodeModel,
INodePropertiesBean<?>> loadPropertiesViewNode
(IElementWithTask<NodeModel> nodeWithTask, Map<ElementKey, com.alibaba.fastjson.JSONObject> customParamsMap, Set<PluginBeanHelper<?, ?>> usedBeanHelpers, IBaseWorkflowEnvironmentData env) Loads the XHTML page, the bean and the custom properties for the given node that is to be edited when that node is selected.static LoadPropsRetVal<TriggerModel,
ITriggerPropertiesBean<?>> loadPropertiesViewTrigger
(IElementWithTask<TriggerModel> triggerWithTask, Map<ElementKey, com.alibaba.fastjson.JSONObject> customParamsMap, Set<PluginBeanHelper<?, ?>> usedBeanHelpers, IBaseWorkflowEnvironmentData env) Loads the XHTML page, the bean and the custom properties for the given trigger that is to be edited when that trigger is selected.static void
queuePropertiesUpdateNode
(FlowchartModel flowchartModel, ActivePropertiesModel<NodeModel, ? extends INodePropertiesBean<?>> propertiesModel, Mandant client) Reads the custom parameters for the given node, and stores them in the given flowchart model.static void
queuePropertiesUpdateTrigger
(FlowchartModel flowchartModel, ActivePropertiesModel<TriggerModel, ? extends ITriggerPropertiesBean<?>> propertiesModel, Mandant client) Reads the custom parameters for the given trigger, and stores them in the given flowchart model.static Set<ElementKey>
refactorFormElementName
(String oldName, String newName, WorkflowModelBean modelBean, Mandant client) static void
updateParamsOfSelectedNode
(FlowchartModel flowchartModel, ActivePropertiesModel<NodeModel, ? extends INodePropertiesBean<?>> nodePropertiesModel, Mandant client) static void
updateParamsOfSelectedTrigger
(FlowchartModel flowchartModel, ActivePropertiesModel<TriggerModel, ? extends ITriggerPropertiesBean<?>> triggerPropertiesModel, Mandant client) static void
updateTaskOfSelectedNode
(UUID oldTaskUuid, ActivePropertiesModel<NodeModel, ? extends INodePropertiesBean<?>> nodePropertiesModel, Mandant client) static void
updateTaskOfSelectedTrigger
(UUID oldTaskUuid, ActivePropertiesModel<TriggerModel, ? extends ITriggerPropertiesBean<?>> triggerPropertiesModel, Mandant client)
-
Method Details
-
checkForUnsavedChanges
public static <TData> CheckForUnsavedChangedResult<WorkflowNode> checkForUnsavedChanges(IEntityContext ec, long processId, UUID taskUuid, UUID elementUuid, TData data, INodeHandler<TData> handler) -
checkForUnsavedChanges
public static <TData> CheckForUnsavedChangedResult<WorkflowTrigger> checkForUnsavedChanges(IEntityContext ec, long processId, UUID taskUuid, UUID elementUuid, TData data, ITriggerHandler<TData> handler) -
findElementFuzzy
public static FlowchartSelection<?> findElementFuzzy(AssociatesModel associatesModel, FlowchartModel flowchartModel, PropertiesPanelModel propertiesPanelModel) Attempts to find the workflow element (node or trigger) indicated by the currentPropertiesPanelModel.getSelection()
. When no exact match could be found, uses a fallback. This may happen when an element is moved to a different task, so that its task UUID does not match anymore. This method then searches for an element with the same UUID in another task.- Parameters:
associatesModel
- Current associates model with data.flowchartModel
- Current flowchart model with the workflow process and tasks.propertiesPanelModel
- Current properties panel model with a selection.- Returns:
- The selection representing the item selected in the properties panel, if any could be found.
-
getLabelOfSelectedElement
public static String getLabelOfSelectedElement(IBaseWorkflowEnvironmentData env, WorkflowModelBean modelBean, IWorkflowProvider provider) Finds the label of the currently selected element.- Parameters:
env
- Current environment data with the client and locale.modelBean
- Model bean with the relevant view state.provider
- Provider for accessing related entities.- Returns:
- The label of the currently selected elemnt empty string if none is selected.
-
loadPropertiesViewNode
public static LoadPropsRetVal<NodeModel,INodePropertiesBean<?>> loadPropertiesViewNode(IElementWithTask<NodeModel> nodeWithTask, Map<ElementKey, com.alibaba.fastjson.JSONObject> customParamsMap, Set<PluginBeanHelper<?, throws Exception?>> usedBeanHelpers, IBaseWorkflowEnvironmentData env) Loads the XHTML page, the bean and the custom properties for the given node that is to be edited when that node is selected.- Parameters:
nodeWithTask
- Node that was selected.customParamsMap
- Map with the custom parameters map of all nodes and elements.usedBeanHelpers
- Plugin bean helpers for beans used by plugins.env
- Environment data with the client, project, locale etc.- Returns:
- The loaded XHTML page, bean, and custom properties.
- Throws:
Exception
- When the data for the node could not be loaded.
-
loadPropertiesViewTrigger
public static LoadPropsRetVal<TriggerModel,ITriggerPropertiesBean<?>> loadPropertiesViewTrigger(IElementWithTask<TriggerModel> triggerWithTask, Map<ElementKey, com.alibaba.fastjson.JSONObject> customParamsMap, Set<PluginBeanHelper<?, throws Exception?>> usedBeanHelpers, IBaseWorkflowEnvironmentData env) Loads the XHTML page, the bean and the custom properties for the given trigger that is to be edited when that trigger is selected.- Parameters:
triggerWithTask
- Trigger that was selected.customParamsMap
- Map with the custom parameters map of all nodes and elements.usedBeanHelpers
- Plugin bean helpers for beans used by plugins.env
- Environment data with the client, project, locale etc.- Returns:
- The loaded XHTML page, bean, and custom properties.
- Throws:
Exception
- When the data for the node could not be loaded.
-
queuePropertiesUpdateNode
public static void queuePropertiesUpdateNode(FlowchartModel flowchartModel, ActivePropertiesModel<NodeModel, ? extends INodePropertiesBean<?>> propertiesModel, Mandant client) throws FastJsonExceptionReads the custom parameters for the given node, and stores them in the given flowchart model.- Parameters:
flowchartModel
- Flowchart model where the new custom node parameters are stored.propertiesModel
- Properties model with the custom parameters.client
- Client scope for locating client node plugin.- Throws:
FastJsonException
- When the JSON could not be converted.
-
queuePropertiesUpdateTrigger
public static void queuePropertiesUpdateTrigger(FlowchartModel flowchartModel, ActivePropertiesModel<TriggerModel, ? extends ITriggerPropertiesBean<?>> propertiesModel, Mandant client) throws FastJsonExceptionReads the custom parameters for the given trigger, and stores them in the given flowchart model.- Parameters:
flowchartModel
- Flowchart model where the new custom trigger parameters are stored.propertiesModel
- Properties model with the custom parameters.client
- Client scope for locating client trigger plugin.- Throws:
FastJsonException
- When the JSON could not be converted.
-
refactorFormElementName
public static Set<ElementKey> refactorFormElementName(String oldName, String newName, WorkflowModelBean modelBean, Mandant client) throws Exception - Throws:
Exception
-
updateParamsOfSelectedNode
public static void updateParamsOfSelectedNode(FlowchartModel flowchartModel, ActivePropertiesModel<NodeModel, ? extends INodePropertiesBean<?>> nodePropertiesModel, Mandant client) throws Exception- Throws:
Exception
-
updateParamsOfSelectedTrigger
public static void updateParamsOfSelectedTrigger(FlowchartModel flowchartModel, ActivePropertiesModel<TriggerModel, ? extends ITriggerPropertiesBean<?>> triggerPropertiesModel, Mandant client) throws Exception- Throws:
Exception
-
updateTaskOfSelectedNode
public static void updateTaskOfSelectedNode(UUID oldTaskUuid, ActivePropertiesModel<NodeModel, ? extends INodePropertiesBean<?>> nodePropertiesModel, Mandant client) throws Exception- Throws:
Exception
-
updateTaskOfSelectedTrigger
public static void updateTaskOfSelectedTrigger(UUID oldTaskUuid, ActivePropertiesModel<TriggerModel, ? extends ITriggerPropertiesBean<?>> triggerPropertiesModel, Mandant client) throws Exception- Throws:
Exception
-