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 using `WorkflowEngine.getProcessLauncher(PublishedProcessKey)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getInputParameterDefaultString(String aName)`
  Returns the default value of the specified input parameter as defined in the workflow definition.
  `String`
  `getInputParameterString(String aName)`
  Returns the value of the specified input parameter.
  `PublishedProcessKey`
  `getPublishedProcessKey()`
  Returns the publication identifier associated to the workflow launcher.
  `boolean`
  `isDefinedAsInputParameter(String aName)`
  Returns whether a specified variable name is defined in the data context as an input parameter.
  `boolean`
  `isForegroundSubworkflow()`
  Indicates whether the sub-workflow is considered has a foreground sub-workflow.
  `ProcessInstanceKey`
  `launchProcess()`
  Starts a new workflow instance.
  `ProcessLauncherResult`
  `launchProcessWithResult()`
  Starts a new workflow instance.
  `void`
  `setCreator(UserReference creator)`
  Specifies the creator of the new workflow instance to be launched.
  `void`
  `setDescription(UserMessage description)`
  Specifies the description of the new workflow instance to be launched.
  `void`
  `setInputParameter(String aName, String aValue)`
  Initializes an input variable of the data context of the new workflow instance to be launched.
  `void`
  `setLabel(UserMessage label)`
  Specifies the label of the new workflow instance to be launched.
  `void`
  `setPriority(Integer priority)`
  Specifies the priority of the new workflow instance to be launched.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### 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.
    See Also:
      - `ProcessExecutionContext.getProcessInstanceLabel(java.util.Locale)`

  - ### 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.
    See Also:
      - `ProcessExecutionContext.getProcessInstanceDescription(java.util.Locale)`

  - ### setCreator

    public void setCreator(UserReference creator)
    Specifies the creator of the new workflow instance to be launched.
    See Also:
      - `ProcessExecutionInfoContext.getProcessInstanceCreator()`

  - ### setPriority

    public void setPriority(Integer priority)
    Specifies the priority of the new workflow instance to be launched. Default priority is `null`.

  - ### 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. Use `SubWorkflowsCreationContext.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 a `ProcessLauncherResult`. 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. Use `SubWorkflowsCreationContext.launchSubWorkflows()` instead.
      `OperationException`
    Since:
      5.5.1
    See Also:
      - `ProcessLauncherResult`