Package com.mendix.workflows
Interface Workflows
public interface Workflows
Provides an interface to the workflow component of the runtime server.
-
Method Summary
Modifier and TypeMethodDescriptiongetDefinition
(String workflowName) Returns a workflow definition for the specified name.getUserTask
(IContext context, IMendixObject userTask) Retrieves the user task object for the specified Mendix object.getWorkflow
(IContext context, IMendixObject workflow) Retrieves the workflow object for the specified Mendix object.Collection
<? extends Workflow> getWorkflows
(IContext context, IMendixObject workflowContext) Retrieves the workflow objects that are associated with the specified context object.instantiate
(IContext context, String workflowName, IMendixObject workflowContext) Instantiates a new workflow and returns the object representing it.void
lockWorkflowDefinition
(IContext context, String workflowName, boolean pauseAllWorkflows) Locks the workflow definition for the specified workflow name.void
unlockWorkflowDefinition
(IContext context, String workflowName, boolean resumeAllPausedWorkflows) Unlocks the workflow definition for the specified workflow name.
-
Method Details
-
getDefinition
Returns a workflow definition for the specified name. No check is performed whether the name actually exists in the application.- Parameters:
workflowName
- the name of the workflow- Returns:
- the workflow definition
- Throws:
MendixRuntimeException
- when no workflow definition exists for the specified name
-
instantiate
Instantiates a new workflow and returns the object representing it.- Parameters:
context
- the context in which to create the workflowworkflowName
- the name of the workflowworkflowContext
- the context parameter object to associate with the workflow- Returns:
- the instantiated workflow
-
getWorkflow
Retrieves the workflow object for the specified Mendix object.- Parameters:
context
- the context in which to retrieve the workflowworkflow
- the Mendix object for the workflow instance- Returns:
- the workflow object
-
getWorkflows
Retrieves the workflow objects that are associated with the specified context object.- Parameters:
context
- the context in which to retrieve the workflowsworkflowContext
- the context parameter object the workflows should be associated with- Returns:
- the list of workflows
-
lockWorkflowDefinition
Locks the workflow definition for the specified workflow name.- Parameters:
context
- the context in which to lock the definitionworkflowName
- the name of the workflowpauseAllWorkflows
- indicates whether to pause all workflow instances with the same definition- Throws:
UserException
- if the workflow definition has already been locked
-
unlockWorkflowDefinition
void unlockWorkflowDefinition(IContext context, String workflowName, boolean resumeAllPausedWorkflows) Unlocks the workflow definition for the specified workflow name.- Parameters:
context
- the context in which to unlock the definitionworkflowName
- the name of the workflowresumeAllPausedWorkflows
- indicates whether to resume all paused workflow instances with the same definition- Throws:
UserException
- if the workflow definition is not locked
-
getUserTask
Retrieves the user task object for the specified Mendix object.- Parameters:
context
- the context in which to retrieve the user taskuserTask
- the Mendix object for the user task instance- Returns:
- the user task object
-