org.activiti.engine.runtime

## Interface ProcessInstanceBuilder

-     public interface ProcessInstanceBuilder

  Helper for starting new ProcessInstance. An instance can be obtained through `RuntimeService.createProcessInstanceBuilder()`. processDefinitionId or processDefinitionKey should be set before calling `start()` to start a process instance.
  Author:
    Bassam Al-Sarori

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ProcessInstanceBuilder` | `addVariable(String variableName, Object value)` Add a variable to the process instance
    `ProcessInstanceBuilder` | `businessKey(String businessKey)` Set the businessKey of process instance
    `ProcessInstanceBuilder` | `processDefinitionId(String processDefinitionId)` Set the id of the process definition
    `ProcessInstanceBuilder` | `processDefinitionKey(String processDefinitionKey)` Set the key of the process definition, latest version of the process definition with the given key.
    `ProcessInstanceBuilder` | `processInstanceName(String processInstanceName)` Set the name of process instance
    `ProcessInstance` | `start()` Start the process instance
    `ProcessInstanceBuilder` | `tenantId(String tenantId)` Set the tenantId of process instance

- - ### Method Detail

    - #### processDefinitionId

          ProcessInstanceBuilder processDefinitionId(String processDefinitionId)

      Set the id of the process definition

    - #### processDefinitionKey

          ProcessInstanceBuilder processDefinitionKey(String processDefinitionKey)

      Set the key of the process definition, latest version of the process definition with the given key. If processDefinitionId was set this will be ignored

    - #### processInstanceName

          ProcessInstanceBuilder processInstanceName(String processInstanceName)

      Set the name of process instance

    - #### businessKey

          ProcessInstanceBuilder businessKey(String businessKey)

      Set the businessKey of process instance

    - #### tenantId

          ProcessInstanceBuilder tenantId(String tenantId)

      Set the tenantId of process instance

    - #### addVariable

          ProcessInstanceBuilder addVariable(String variableName,
                                             Object value)

      Add a variable to the process instance

    - #### start

          ProcessInstance start()

      Start the process instance
      Throws:
        `ActivitiIllegalArgumentException` - if processDefinitionKey and processDefinitionId are null
        `ActivitiObjectNotFoundException` - when no process definition is deployed with the given processDefinitionKey or processDefinitionId

Copyright © 2016 Alfresco. All rights reserved.