Interface WorkflowContext

All Known Implementing Classes:
WorkflowService

public interface WorkflowContext
This WorkflowContext provides methods to resolve a valid model version and fetch a thread save instance of a load a org.openbpmn.bpmn.BPMNModel.
Version:
1.0
Author:
imixs.com
See Also:
  • Method Details

    • fetchModel

      org.openbpmn.bpmn.BPMNModel fetchModel(String version) throws ModelException
      This method returns a exclusive thread save BPMNModel instance. The method must not return a shared model instance. The method must throw a ModelException in case no model matching the requested version exists. A client can call findModelVersionByWorkitem to resolve a valid model version for a workitem.
      Parameters:
      version - - valid model version
      Returns:
      an instance of a BPMNModel to be used in a thread save way
      Throws:
      ModelException
    • findModelVersionByWorkitem

      String findModelVersionByWorkitem(ItemCollection workitem) throws ModelException
      Returns a valid model version for a given workitem. A model version can also be specified as a regular expression or can be resolved only by a given workflow group. The method must throw a ModelException in case no matching model version exists.
      Parameters:
      group - - name of the workflow group
      Returns:
      version matching the params of the given workitem
      Throws:
      ModelException
    • findModelVersionByRegEx

      String findModelVersionByRegEx(String modelRegex) throws ModelException
      Returns the highest version matching a given regular expression. The method must throw a ModelException in case no matching model version exists.
      Parameters:
      modelRegex - - regular expression
      Returns:
      version matching the regex
      Throws:
      ModelException
    • findModelVersionByGroup

      String findModelVersionByGroup(String group) throws ModelException
      Returns returns the hightest version matching a given workflow group. The method must throw a ModelException in case no matching model version exists.
      Parameters:
      group - - name of the workflow group
      Returns:
      version matching the group
      Throws:
      ModelException
    • getWorkItem

      ItemCollection getWorkItem(String uniqueid)
      This method loads a Workitem with the corresponding uniqueid.
    • processWorkItem

      This method processes a workItem. A workitem have to provide at least the properties '$modelversion', '$taskid' and '$eventid'
      Parameters:
      workitem - - the workItem to be processed
      Returns:
      updated version of the processed workItem
      Throws:
      AccessDeniedException - - thrown if the user has insufficient access to update the workItem
      ProcessingErrorException - - thrown if the workitem could not be processed by the workflowKernel
      PluginException - - thrown if processing by a plugin fails
      ModelException
    • evalNextTask

      The method evaluates the next task for a process instance (workitem) based on the current model definition. A Workitem must at least provide the properties $TASKID and $EVENTID.
      Returns:
      Task entity
      Throws:
      PluginException
      ModelException
    • evalWorkflowResult

      ItemCollection evalWorkflowResult(ItemCollection event, String xmlTag, ItemCollection documentContext, boolean resolveItemValues) throws PluginException
      The method evaluates the WorkflowResult for a given BPMN event and returns a ItemCollection containing all item values of a specified xml tag. Each tag definition must contain at least a name attribute and may contain an optional list of additional attributes.
      Parameters:
      event -
      xmlTag - - XML tag to be evaluated
      documentContext -
      resolveItemValues - - if true, itemValue tags will be resolved.
      Returns:
      eval itemCollection or null if no tags are contained in the workflow result.
      Throws:
      PluginException - if the xml structure is invalid
    • evalWorkflowResult

      ItemCollection evalWorkflowResult(ItemCollection event, String tag, ItemCollection documentContext) throws PluginException
      The method evaluates the WorkflowResult for a given BPMN event and returns a ItemCollection containing all item values of a specified tag name. Each tag definition of a WorkflowResult contains a name and a optional list of additional attributes. The method generates a item for each content element and attribute value.
      e.g. text
      will result in the attributes 'comment' with value 'text' and 'comment.ignore' with the value 'true'

      Parameters:
      event -
      tag - - tag to be evaluated
      documentContext -
      Returns:
      Throws:
      PluginException