Class 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 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 null unless isNodePrototype() returns true.
      • getTriggerPrototype

        public TriggerModel getTriggerPrototype()
        Returns:
        The workflow trigger to use as a prototype. This returns null unless isTriggerPrototype() returns true.
      • 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 - If clientId points 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 - If clientId points 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.