Package com.orchestranetworks.workflow
Class ProcessLauncher
- java.lang.Object
-
- com.orchestranetworks.workflow.ProcessLauncher
-
public final class ProcessLauncher extends Object
Prepares and launches a workflow instance. A ProcessLauncher is created usingWorkflowEngine.getProcessLauncher(PublishedProcessKey)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetInputParameterDefaultString(String aName)Returns the default value of the specified input parameter as defined in the workflow definition.StringgetInputParameterString(String aName)Returns the value of the specified input parameter.PublishedProcessKeygetPublishedProcessKey()Returns the publication identifier associated to the workflow launcher.booleanisDefinedAsInputParameter(String aName)Returns whether a specified variable name is defined in the data context as an input parameter.booleanisForegroundSubworkflow()Indicates whether the sub-workflow is considered has a foreground sub-workflow.ProcessInstanceKeylaunchProcess()Starts a new workflow instance.ProcessLauncherResultlaunchProcessWithResult()Starts a new workflow instance.voidsetCreator(UserReference creator)Specifies the creator of the new workflow instance to be launched.voidsetDescription(UserMessage description)Specifies the description of the new workflow instance to be launched.voidsetInputParameter(String aName, String aValue)Initializes an input variable of the data context of the new workflow instance to be launched.voidsetLabel(UserMessage label)Specifies the label of the new workflow instance to be launched.voidsetPriority(Integer priority)Specifies the priority of the new workflow instance to be launched.
-
-
-
Method Detail
-
getPublishedProcessKey
public PublishedProcessKey getPublishedProcessKey()
Returns the publication identifier associated to the workflow launcher.- Since:
- 5.7.1-fixN
-
setLabel
public void setLabel(UserMessage label)
Specifies the label of the new workflow instance to be launched. If this method is not used, the label of the workflow publication will be used instead.
-
setDescription
public void setDescription(UserMessage description)
Specifies the description of the new workflow instance to be launched. If this method is not used, the description of the workflow publication will be used instead.
-
setCreator
public void setCreator(UserReference creator)
Specifies the creator of the new workflow instance to be launched.
-
setPriority
public void setPriority(Integer priority)
Specifies the priority of the new workflow instance to be launched. Default priority isnull.
-
isForegroundSubworkflow
public boolean isForegroundSubworkflow()
Indicates whether the sub-workflow is considered has a foreground sub-workflow.- Since:
- 6.0.0
-
setInputParameter
public void setInputParameter(String aName, String aValue)
Initializes an input variable of the data context of the new workflow instance to be launched.- Parameters:
aName- name of a data context variable. This name must match an input variable of the data context of the workflow model or else an exception will be thrown at the workflow launch.- See Also:
launchProcess(),launchProcessWithResult()
-
getInputParameterString
public String getInputParameterString(String aName)
Returns the value of the specified input parameter.
-
getInputParameterDefaultString
public String getInputParameterDefaultString(String aName)
Returns the default value of the specified input parameter as defined in the workflow definition.
-
isDefinedAsInputParameter
public boolean isDefinedAsInputParameter(String aName)
Returns whether a specified variable name is defined in the data context as an input parameter.- Parameters:
aName- name of a data context variable.- Since:
- 6.0.0
- See Also:
getInputParameterString(String),getInputParameterDefaultString(String)
-
launchProcess
public ProcessInstanceKey launchProcess() throws OperationException
Starts a new workflow instance. This method can be called several times. A new workflow instance will be created every time.The permissions will be checked if and only if the EBX® property ebx.manager.workflow.launcher.checkPermission.activated is set to true.
- Throws:
IllegalArgumentException- if a specified input parameter name is not declared in the workflow definition's data context, or the corresponding variable is not declared as being an input parameter.IllegalStateException- if this method is called to launch a sub-workflow. UseSubWorkflowsCreationContext.launchSubWorkflows()instead.OperationException
-
launchProcessWithResult
public ProcessLauncherResult launchProcessWithResult() throws OperationException
Starts a new workflow instance. This method can be called several times. A new workflow instance will be created every time.This method is equivalent to
launchProcess()but returns aProcessLauncherResult. This allows the caller to retrieve the key of the created workflow instance and, if the synchronous mode is enabled ("automatically opens the first step"), the first created work item.The permissions will be checked if and only if the EBX® property ebx.manager.workflow.launcher.checkPermission.activated is set to true.
- Throws:
IllegalArgumentException- if a specified input parameter name is not declared in the workflow definition's data context, or the corresponding variable is not declared as being an input parameter.IllegalStateException- if this method is called to launch a sub-workflow. UseSubWorkflowsCreationContext.launchSubWorkflows()instead.OperationException- Since:
- 5.5.1
- See Also:
ProcessLauncherResult
-
-