org.camunda.bpm.engine.impl
Class ProcessInstantiationBuilderImpl

java.lang.Object
  extended by org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl
All Implemented Interfaces:
ActivityInstantiationBuilder<ProcessInstantiationBuilder>, InstantiationBuilder<ProcessInstantiationBuilder>, ProcessInstantiationBuilder

public class ProcessInstantiationBuilderImpl
extends Object
implements ProcessInstantiationBuilder

Simply wraps a modification builder because their API is equivalent.

Author:
Thorben Lindhauer

Field Summary
protected  String businessKey
           
protected  String caseInstanceId
           
protected  CommandContext commandContext
           
protected  CommandExecutor commandExecutor
           
protected  ProcessInstanceModificationBuilderImpl modificationBuilder
           
protected  String processDefinitionId
           
protected  String processDefinitionKey
           
 
Constructor Summary
ProcessInstantiationBuilderImpl(CommandContext commandContext, String processDefinitionId, String processDefinitionKey)
           
ProcessInstantiationBuilderImpl(CommandExecutor commandExecutor, String processDefinitionId, String processDefinitionKey)
           
ProcessInstantiationBuilderImpl(String processDefinitionId, String processDefinitionKey)
           
 
Method Summary
 ProcessInstantiationBuilder businessKey(String businessKey)
          Set the business key for the process instance
 ProcessInstantiationBuilder caseInstanceId(String caseInstanceId)
          Associate a case instance with the process instance
 ProcessInstance execute()
          Start the process instance by executing all instructions in the order they are submitted.
 ProcessInstance execute(boolean skipCustomListeners, boolean skipIoMappings)
          Start the process instance by executing all instructions in the order they are submitted.
 String getBusinessKey()
           
 String getCaseInstanceId()
           
 ProcessInstanceModificationBuilderImpl getModificationBuilder()
           
 String getProcessDefinitionId()
           
 String getProcessDefinitionKey()
           
 ProcessInstantiationBuilder setVariable(String name, Object value)
          Adds a variable to be set when the current instruction is executed.
 ProcessInstantiationBuilder setVariableLocal(String name, Object value)
          Adds a local variable to be set when the current instruction is executed.
 ProcessInstantiationBuilder setVariables(Map<String,Object> variables)
          Adds all variables to be set when the current instruction is executed
 ProcessInstantiationBuilder setVariablesLocal(Map<String,Object> variables)
          Adds all local variables to be set when the current instruction is executed
 ProcessInstantiationBuilder startAfterActivity(String activityId)
          Submits an instruction that behaves like InstantiationBuilder.startTransition(String) and always instantiates the single outgoing sequence flow of the given activity.
 ProcessInstantiationBuilder startBeforeActivity(String activityId)
          Submits the instruction:
 ProcessInstantiationBuilder startTransition(String transitionId)
          Submits the instruction:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandExecutor

protected CommandExecutor commandExecutor

commandContext

protected CommandContext commandContext

processDefinitionId

protected String processDefinitionId

processDefinitionKey

protected String processDefinitionKey

businessKey

protected String businessKey

caseInstanceId

protected String caseInstanceId

modificationBuilder

protected ProcessInstanceModificationBuilderImpl modificationBuilder
Constructor Detail

ProcessInstantiationBuilderImpl

public ProcessInstantiationBuilderImpl(String processDefinitionId,
                                       String processDefinitionKey)

ProcessInstantiationBuilderImpl

public ProcessInstantiationBuilderImpl(CommandExecutor commandExecutor,
                                       String processDefinitionId,
                                       String processDefinitionKey)

ProcessInstantiationBuilderImpl

public ProcessInstantiationBuilderImpl(CommandContext commandContext,
                                       String processDefinitionId,
                                       String processDefinitionKey)
Method Detail

startBeforeActivity

public ProcessInstantiationBuilder startBeforeActivity(String activityId)
Description copied from interface: InstantiationBuilder

Submits the instruction:

Start before the specified activity.

In particular:

Specified by:
startBeforeActivity in interface InstantiationBuilder<ProcessInstantiationBuilder>
Parameters:
activityId - the activity to instantiate

startAfterActivity

public ProcessInstantiationBuilder startAfterActivity(String activityId)
Description copied from interface: InstantiationBuilder
Submits an instruction that behaves like InstantiationBuilder.startTransition(String) and always instantiates the single outgoing sequence flow of the given activity. Does not consider asyncAfter.

Specified by:
startAfterActivity in interface InstantiationBuilder<ProcessInstantiationBuilder>
Parameters:
activityId - the activity for which the outgoing flow should be executed

startTransition

public ProcessInstantiationBuilder startTransition(String transitionId)
Description copied from interface: InstantiationBuilder

Submits the instruction:

Start a sequence flow.

In particular:

Specified by:
startTransition in interface InstantiationBuilder<ProcessInstantiationBuilder>
Parameters:
transitionId - the sequence flow to execute

setVariable

public ProcessInstantiationBuilder setVariable(String name,
                                               Object value)
Description copied from interface: ActivityInstantiationBuilder
Adds a variable to be set when the current instruction is executed.

Specified by:
setVariable in interface ActivityInstantiationBuilder<ProcessInstantiationBuilder>

setVariableLocal

public ProcessInstantiationBuilder setVariableLocal(String name,
                                                    Object value)
Description copied from interface: ActivityInstantiationBuilder
Adds a local variable to be set when the current instruction is executed.

Specified by:
setVariableLocal in interface ActivityInstantiationBuilder<ProcessInstantiationBuilder>

setVariables

public ProcessInstantiationBuilder setVariables(Map<String,Object> variables)
Description copied from interface: ActivityInstantiationBuilder
Adds all variables to be set when the current instruction is executed

Specified by:
setVariables in interface ActivityInstantiationBuilder<ProcessInstantiationBuilder>

setVariablesLocal

public ProcessInstantiationBuilder setVariablesLocal(Map<String,Object> variables)
Description copied from interface: ActivityInstantiationBuilder
Adds all local variables to be set when the current instruction is executed

Specified by:
setVariablesLocal in interface ActivityInstantiationBuilder<ProcessInstantiationBuilder>

businessKey

public ProcessInstantiationBuilder businessKey(String businessKey)
Description copied from interface: ProcessInstantiationBuilder
Set the business key for the process instance

Specified by:
businessKey in interface ProcessInstantiationBuilder

caseInstanceId

public ProcessInstantiationBuilder caseInstanceId(String caseInstanceId)
Description copied from interface: ProcessInstantiationBuilder
Associate a case instance with the process instance

Specified by:
caseInstanceId in interface ProcessInstantiationBuilder

execute

public ProcessInstance execute()
Description copied from interface: ProcessInstantiationBuilder
Start the process instance by executing all instructions in the order they are submitted. Custom execution and task listeners, as well as task input output mappings are executed.

Specified by:
execute in interface ProcessInstantiationBuilder
Returns:
the newly created process instance

execute

public ProcessInstance execute(boolean skipCustomListeners,
                               boolean skipIoMappings)
Description copied from interface: ProcessInstantiationBuilder
Start the process instance by executing all instructions in the order they are submitted.

Specified by:
execute in interface ProcessInstantiationBuilder
Parameters:
skipCustomListeners - specifies whether custom listeners (task and execution) should be invoked when executing the instructions
skipIoMappings - specifies whether input/output mappings for tasks should be invoked throughout the transaction when executing the instructions
Returns:
the newly created process instance

getProcessDefinitionId

public String getProcessDefinitionId()

getProcessDefinitionKey

public String getProcessDefinitionKey()

getModificationBuilder

public ProcessInstanceModificationBuilderImpl getModificationBuilder()

getBusinessKey

public String getBusinessKey()

getCaseInstanceId

public String getCaseInstanceId()


Copyright © 2015 camunda services GmbH. All rights reserved.