Class WorkflowElementWithDeserializedModel<TData,TElement>

java.lang.Object
de.xima.fc.workflow.processor.model.WorkflowElementWithDeserializedModel<TData,TElement>
Type Parameters:
TData - Type of the workflow element's properties model.
TElement - Type of the workflow element, i.e. a node or trigger.
All Implemented Interfaces:
IElementKeyProviding, IWorkflowElementWithDeserializedModel<TData,TElement>

public final class WorkflowElementWithDeserializedModel<TData,TElement> extends Object implements IWorkflowElementWithDeserializedModel<TData,TElement>
Implementation of IWorkflowElementWithDeserializedModel that loads the data lazily when requested.
Since:
7.0.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • getData

      public TData getData()
      Specified by:
      getData in interface IWorkflowElementWithDeserializedModel<TData,TElement>
      Returns:
      The custom data of the workflow element. This is passed for convenience, it the the same as ICustomParametersProviding.getCustomParameters(), but already deserialized and updated.
    • getElement

      public TElement getElement()
      Specified by:
      getElement in interface IWorkflowElementWithDeserializedModel<TData,TElement>
      Returns:
      The workflow element, i.e. a node or trigger.
    • getKey

      public ElementKey getKey()
      Specified by:
      getKey in interface IElementKeyProviding
      Returns:
      The key that identifies this instance.
    • withCustomLocator

      public static <TData, TElement> IWorkflowElementWithDeserializedModel<TData,TElement> withCustomLocator(TElement element, ElementKey key, Function<TElement,TData> dataLocator, Mandant client)
      Creates a new wrapped workflow element that retrieves the custom properties on demand by using the given locator.
      Type Parameters:
      TData - Type of the workflow element's properties model.
      TElement - Type of the workflow element, i.e. a node or trigger.
      Parameters:
      element - The element to wrap.
      key - Key of the element.
      dataLocator - Function that can retrieve the data to associate with the element.
      client - The current client context for locating client node or trigger plugins.
      Returns:
      A new wrapped workflow element for the given element.
    • withData

      public static <TData, TElement> IWorkflowElementWithDeserializedModel<TData,TElement> withData(TElement element, ElementKey key, TData data, Mandant client)
      Creates a new wrapped workflow element that uses the given custom properties.
      Type Parameters:
      TData - Type of the workflow element's properties model.
      TElement - Type of the workflow element, i.e. a node or trigger.
      Parameters:
      element - The element to wrap.
      key - Key of the element.
      data - The data to associate with the element.
      client - The current client context for locating client node or trigger plugins.
      Returns:
      A new wrapped workflow element for the given element.
    • withDataOnDemand

      public static <TData, TElement extends IWorkflowElementEntity> IWorkflowElementWithDeserializedModel<TData,TElement> withDataOnDemand(TElement element, ElementKey key, Mandant client)
      Creates a new wrapped workflow element that deserializes the custom properties on demand.
      Type Parameters:
      TData - Type of the workflow element's properties model.
      TElement - Type of the workflow element, i.e. a node or trigger.
      Parameters:
      element - The element to wrap.
      key - Key of the element.
      client - The current client context for locating client node or trigger plugins.
      Returns:
      A new wrapped workflow element for the given element.
    • withDataOnDemand

      public static <TData> IWorkflowElementWithDeserializedModel<TData,WorkflowNode> withDataOnDemand(WorkflowNode node, Mandant client)
      Creates a new wrapped workflow node that deserializes the custom properties on demand.
      Type Parameters:
      TData - Type of the workflow node's properties model.
      Parameters:
      node - The node to wrap.
      client - The current client context for locating client node or trigger plugins.
      Returns:
      A new wrapped workflow node for the given node.
    • withDataOnDemand

      public static <TData> IWorkflowElementWithDeserializedModel<TData,WorkflowTrigger> withDataOnDemand(WorkflowTrigger trigger, Mandant client)
      Creates a new wrapped workflow trigger that deserializes the custom properties on demand.
      Type Parameters:
      TData - Type of the workflow trigger's properties model.
      Parameters:
      trigger - The trigger to wrap.
      client - The current client context for locating client node or trigger plugins.
      Returns:
      A new wrapped workflow trigger for the given trigger.