Package de.xima.fc.workflow.taglib.model
Class ElementPrototypeModel
- java.lang.Object
-
- de.xima.fc.workflow.taglib.model.ElementPrototypeModel
-
- All Implemented Interfaces:
Serializable
public final class ElementPrototypeModel extends Object implements Serializable
JSON-convertible client model that represents a prototype for a flowchart element that corresponds to a HTML element. This is used to create new triggers and nodes when the user drags the element into the flowchart diagram.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ElementPrototypeModelforNode(INodeModelPrototype proto, String clientId, int rowIndex)Creates a new model for the given node prototype.static ElementPrototypeModelforTrigger(ITriggerModelPrototype proto, String clientId, int rowIndex)Creates a new model for the given trigger prototype.StringgetClientId()Map<UUID,com.alibaba.fastjson.JSONObject>getCustomParamsMap()NodeModelgetNodePrototype()intgetRowIndex()TriggerModelgetTriggerPrototype()booleanisNodePrototype()booleanisTriggerPrototype()
-
-
-
Method Detail
-
getCustomParamsMap
public Map<UUID,com.alibaba.fastjson.JSONObject> getCustomParamsMap()
- Returns:
- Map between the element key and the custom properties JON for that element.
-
getClientId
public String getClientId()
- Returns:
- If this returns a non-empty string, it is interpreted as a client ID of a DOM element. That element is then used as a drag source for the user to create a new flowchart element with this prototype.
-
getRowIndex
public int getRowIndex()
- Returns:
- If
getClientId()points to a list of item, the index of the source element in that list. Otherwise, this should return-1.
-
getNodePrototype
public NodeModel getNodePrototype()
- Returns:
- The workflow node to use as a prototype. This returns
nullunlessisNodePrototype()returnstrue.
-
getTriggerPrototype
public TriggerModel getTriggerPrototype()
- Returns:
- The workflow trigger to use as a prototype. This returns
nullunlessisTriggerPrototype()returnstrue.
-
isNodePrototype
public boolean isNodePrototype()
- Returns:
- Whether this instance represents a prototype for a
WorkflowNode.
-
isTriggerPrototype
public boolean isTriggerPrototype()
- Returns:
- Whether this instance represents a prototype for a
WorkflowTrigger.
-
forNode
public static ElementPrototypeModel forNode(INodeModelPrototype proto, String clientId, int rowIndex)
Creates a new model for the given node prototype.- Parameters:
proto- Node model prototype.clientId- If a non-empty string, it is interpreted as a client ID of a DOM element. That element is then used as a drag source for the user to create a new flowchart element with this prototype.rowIndex- IfclientIdpoints to a list of items, the index of the source element in that list. Otherwise, this should return-1.- Returns:
- The client model for the prototype.
-
forTrigger
public static ElementPrototypeModel forTrigger(ITriggerModelPrototype proto, String clientId, int rowIndex)
Creates a new model for the given trigger prototype.- Parameters:
proto- Trigger model prototype.clientId- If a non-empty string, it is interpreted as a client ID of a DOM element. That element is then used as a drag source for the user to create a new flowchart element with this prototype.rowIndex- IfclientIdpoints to a list of items, the index of the source element in that list. Otherwise, this should return-1.- Returns:
- The client model for the prototype.
-
-