Interface Workflow


public interface Workflow
Provides an interface for managing workflows.
  • Method Details

    • getMendixObject

      IMendixObject getMendixObject()
      Gets the workflow mendix object.
      Returns:
      the workflow mendix object
    • getWorkflowContext

      IMendixObject getWorkflowContext()
      Gets the workflow parameter context object.
      Returns:
      the workflow parameter context object
    • setWorkflowContext

      void setWorkflowContext(IMendixObject contextObject)
      Sets the workflow parameter context object.
      Parameters:
      contextObject - workflow parameter context object
    • pause

      void pause()
      Pauses the workflow.
    • unpause

      void unpause()
      Unpauses the paused workflow.
    • restart

      void restart()
      Restarts the workflow.
      Note that canRestart() must return true for the workflow to be restartable.
    • retry

      void retry()
      Retries the failed workflow.
      Note that the workflow has to be failed for retry to be applicable.
    • abort

      void abort(String reason)
      Aborts the workflow with a given reason.
      Parameters:
      reason - abort reason to be record
    • markAsResolved

      void markAsResolved()
      Continues the incompatible workflow.
      Note that the workflow must be Incompatible and that canContinue() must return true.
    • openPage

      void openPage()
      Opens the Workflow Admin Page.
    • lockDefinition

      void lockDefinition(boolean pauseAllWorkflows)
      Locks the definition of the workflow.
      Parameters:
      pauseAllWorkflows - parameter for pausing the workflow instances of the definition
      Throws:
      UserException - if the workflow definition has been already locked
    • unlockDefinition

      void unlockDefinition(boolean resumeAllPausedWorkflows)
      Unlocks the definition of the workflow.
      Parameters:
      resumeAllPausedWorkflows - parameter for resuming the workflow instances of the definition
      Throws:
      UserException - if the workflow definition is not locked
    • canRestart

      boolean canRestart()
      Returns whether the workflow is restartable or not.
      Returns:
      true if the workflow is restartable, otherwise return false
    • canContinue

      boolean canContinue()
      Returns whether the workflow can be continued or not.
      Returns:
      true if the workflow can be continued, otherwise return false
    • state

      WorkflowState state()
      Returns the state of workflow.
      Returns:
      the state WorkflowState
    • getCurrentActivities

      Collection<? extends WorkflowActivity> getCurrentActivities()
      Returns the list of current activities.
      Returns:
      the list of current activities
    • getJumpToOptions

      JumpToOptions getJumpToOptions()
      Generates the list of possible workflow activities the workflow can jump to. Sample usage as follows:
      
       Workflow workflow = Core.workflows().getWorkflow(context, workflowObject);
       JumpToOptions jumpToOptions = workflow.getJumpToOptions();
       JumpableWorkflowActivity sourceActivity = jumpToOptions.getCurrentActivities()
           .stream()
           .filter(a -> a.getDetails().getCaption() == "MyUserTask1")
           .findFirst()
           .get();
       WorkflowActivityDetails targetActivity = sourceActivity.getApplicableTargets()
           .stream()
           .filter(a -> a.getCaption() == "MyUserTask2")
           .findFirst()
           .get();
       Workflow updatedWorkflow = jumpToOptions.prepareJumpTo()
           .jumpActivityTo(sourceActivity, targetActivity)
           .applyJumpTo();
       
       
      Returns:
      the interface for jump-to operations