Class ElementPrototypesHelper
- java.lang.Object
-
- de.xima.fc.workflow.designer.helper.ElementPrototypesHelper
-
public class ElementPrototypesHelper extends Object
Static function for creating workflow element prototypes.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<IResourceDescriptor>
collectDescriptors(Set<String> types, IResourceDescriptorLocator locator)
Given a set of workflow element types, collects all JavaScript or CSS resources required by element handlers of those types.static String
concatenateCssResources(Set<IResourceDescriptor> descriptors)
Concatenates the given CSS resources into a single file.static String
concatenateJavaScriptResources(Set<IResourceDescriptor> descriptors)
Concatenates the given JavaScript resources into a single file.static DrawerPanelModel
createDrawerPanelModel(IBaseWorkflowEnvironmentData environmentData, IWorkflowProvider provider, boolean devMode)
Creates the model for the drawer panel that contains all available node and trigger prototypes that can be added to the flowchart.static IInitialNodePrototypeModel
createInitialNodePrototype(IBaseWorkflowEnvironmentData env)
Creates the initial node prototype that is added when a new task is created.static List<org.apache.commons.lang3.tuple.Pair<String,List<IElementPrototypeWrapper<?>>>>
getTaskAddPanelItems(DrawerPanelModel drawerPanel)
Filters the given drawer panel model and returns only those element that represent new triggers (not nodes).static void
updateDrawerPanelModel(IBaseWorkflowEnvironmentData environmentData, WorkflowModelBean modelBean, IWorkflowProvider provider)
Recreates the drawer panel model and requests an UI update.
-
-
-
Method Detail
-
collectDescriptors
public static Set<IResourceDescriptor> collectDescriptors(Set<String> types, IResourceDescriptorLocator locator)
Given a set of workflow element types, collects all JavaScript or CSS resources required by element handlers of those types.- Parameters:
types
- Set of workflow (node or trigger) types to process.locator
- The resource locator for the nodes or elements.- Returns:
- All JavaScript or CSS resource descriptors for the given types.
-
concatenateCssResources
public static String concatenateCssResources(Set<IResourceDescriptor> descriptors)
Concatenates the given CSS resources into a single file.- Parameters:
descriptors
- A set of resources.- Returns:
- A single string with all resources concatenated.
-
concatenateJavaScriptResources
public static String concatenateJavaScriptResources(Set<IResourceDescriptor> descriptors)
Concatenates the given JavaScript resources into a single file.- Parameters:
descriptors
- A set of resources.- Returns:
- A single string with all resources concatenated.
-
createDrawerPanelModel
public static DrawerPanelModel createDrawerPanelModel(IBaseWorkflowEnvironmentData environmentData, IWorkflowProvider provider, boolean devMode)
Creates the model for the drawer panel that contains all available node and trigger prototypes that can be added to the flowchart.- Parameters:
environmentData
- Current environment data with the client, project etc.provider
- Workflow provider passed on to the element handlers.devMode
- Whether dev mode is active. Tries to use uncompressed sources if it is.- Returns:
- The newly creates drawer panel model.
-
createInitialNodePrototype
public static IInitialNodePrototypeModel createInitialNodePrototype(IBaseWorkflowEnvironmentData env)
Creates the initial node prototype that is added when a new task is created. Creates a sequence with an end action of typeEWorkflowNodeType.FC_CHANGE_STATE
that sets the system statereceived
.- Parameters:
env
- Current environment data for accessing the database, looking up node plugins, and localizing the system workflow state name.- Returns:
- The initial node prototype.
-
getTaskAddPanelItems
public static List<org.apache.commons.lang3.tuple.Pair<String,List<IElementPrototypeWrapper<?>>>> getTaskAddPanelItems(DrawerPanelModel drawerPanel)
Filters the given drawer panel model and returns only those element that represent new triggers (not nodes).- Parameters:
drawerPanel
- Current drawer panel model.- Returns:
- List of items for creating a news task with a trigger.
-
updateDrawerPanelModel
public static void updateDrawerPanelModel(IBaseWorkflowEnvironmentData environmentData, WorkflowModelBean modelBean, IWorkflowProvider provider)
Recreates the drawer panel model and requests an UI update.- Parameters:
environmentData
- Environment data for the current workflow designer.modelBean
- Model bean with the workflow designer state.provider
- Provider bean with helper methods for accessing data.
-
-