org.camunda.bpm.engine.impl
Class ProcessInstanceModificationBuilderImpl

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

public class ProcessInstanceModificationBuilderImpl
extends Object
implements ProcessInstanceModificationInstantiationBuilder

Author:
Thorben Lindhauer

Field Summary
protected  CommandContext commandContext
           
protected  CommandExecutor commandExecutor
           
protected  List<AbstractProcessInstanceModificationCommand> operations
           
protected  String processInstanceId
           
protected  org.camunda.bpm.engine.variable.VariableMap processVariables
           
protected  boolean skipCustomListeners
           
protected  boolean skipIoMappings
           
 
Constructor Summary
ProcessInstanceModificationBuilderImpl()
           
ProcessInstanceModificationBuilderImpl(CommandContext commandContext, String processInstanceId)
           
ProcessInstanceModificationBuilderImpl(CommandExecutor commandExecutor, String processInstanceId)
           
ProcessInstanceModificationBuilderImpl(String processInstanceId)
           
 
Method Summary
 ProcessInstanceModificationBuilder cancelActivityInstance(String activityInstanceId)
          Submits the instruction:
 ProcessInstanceModificationBuilder cancelAllForActivity(String activityId)
          Submits the instruction:
 ProcessInstanceModificationBuilder cancelTransitionInstance(String transitionInstanceId)
          Submits the instruction:
 void execute()
          Execute all instructions.
 void execute(boolean skipCustomListeners, boolean skipIoMappings)
           
 CommandContext getCommandContext()
           
 CommandExecutor getCommandExecutor()
           
protected  AbstractInstantiationCmd getCurrentInstantiation()
           
 List<AbstractProcessInstanceModificationCommand> getModificationOperations()
           
 String getProcessInstanceId()
           
 org.camunda.bpm.engine.variable.VariableMap getProcessVariables()
           
 boolean isSkipCustomListeners()
           
 boolean isSkipIoMappings()
           
 void setSkipCustomListeners(boolean skipCustomListeners)
           
 void setSkipIoMappings(boolean skipIoMappings)
           
 ProcessInstanceModificationInstantiationBuilder setVariable(String name, Object value)
          If an instruction is submitted before then the variable is set when the instruction is executed.
 ProcessInstanceModificationInstantiationBuilder setVariableLocal(String name, Object value)
          If an instruction is submitted before then the local variable is set when the instruction is executed.
 ProcessInstanceModificationInstantiationBuilder setVariables(Map<String,Object> variables)
          If an instruction is submitted before then all variables are set when the instruction is executed.
 ProcessInstanceModificationInstantiationBuilder setVariablesLocal(Map<String,Object> variables)
          If an instruction is submitted before then all local variables are set when the instruction is executed.
 ProcessInstanceModificationInstantiationBuilder startAfterActivity(String activityId)
          Submits an instruction that behaves like InstantiationBuilder.startTransition(String) and always instantiates the single outgoing sequence flow of the given activity.
 ProcessInstanceModificationInstantiationBuilder startAfterActivity(String activityId, String ancestorActivityInstanceId)
          Submits an instruction that behaves like ProcessInstanceModificationBuilder.startTransition(String,String) and always instantiates the single outgoing sequence flow of the given activity.
 ProcessInstanceModificationInstantiationBuilder startBeforeActivity(String activityId)
          Submits the instruction:
 ProcessInstanceModificationInstantiationBuilder startBeforeActivity(String activityId, String ancestorActivityInstanceId)
          Submits the instruction:
 ProcessInstanceModificationInstantiationBuilder startTransition(String transitionId)
          Submits the instruction:
 ProcessInstanceModificationInstantiationBuilder startTransition(String transitionId, String ancestorActivityInstanceId)
          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

processInstanceId

protected String processInstanceId

skipCustomListeners

protected boolean skipCustomListeners

skipIoMappings

protected boolean skipIoMappings

operations

protected List<AbstractProcessInstanceModificationCommand> operations

processVariables

protected org.camunda.bpm.engine.variable.VariableMap processVariables
Constructor Detail

ProcessInstanceModificationBuilderImpl

public ProcessInstanceModificationBuilderImpl(CommandExecutor commandExecutor,
                                              String processInstanceId)

ProcessInstanceModificationBuilderImpl

public ProcessInstanceModificationBuilderImpl(CommandContext commandContext,
                                              String processInstanceId)

ProcessInstanceModificationBuilderImpl

public ProcessInstanceModificationBuilderImpl(String processInstanceId)

ProcessInstanceModificationBuilderImpl

public ProcessInstanceModificationBuilderImpl()
Method Detail

cancelActivityInstance

public ProcessInstanceModificationBuilder cancelActivityInstance(String activityInstanceId)
Description copied from interface: ProcessInstanceModificationBuilder

Submits the instruction:

Cancel an activity instance in a process. If this instance has child activity instances (e.g. in a subprocess instance), these children, their grandchildren, etc. are cancelled as well.

Specified by:
cancelActivityInstance in interface ProcessInstanceModificationBuilder
Parameters:
activityInstanceId - the id of the activity instance to cancel

cancelTransitionInstance

public ProcessInstanceModificationBuilder cancelTransitionInstance(String transitionInstanceId)
Description copied from interface: ProcessInstanceModificationBuilder

Submits the instruction:

Cancel a transition instance (i.e. an async continuation) in a process.

Specified by:
cancelTransitionInstance in interface ProcessInstanceModificationBuilder
Parameters:
transitionInstanceId - the id of the transition instance to cancel

cancelAllForActivity

public ProcessInstanceModificationBuilder cancelAllForActivity(String activityId)
Description copied from interface: ProcessInstanceModificationBuilder

Submits the instruction:

Cancel all instances of the given activity in an arbitrary order, which are:

Therefore behaves like ProcessInstanceModificationBuilder.cancelActivityInstance(String) for each individual activity instance and like ProcessInstanceModificationBuilder.cancelTransitionInstance(String) for each individual transition instance.

The cancellation order of the instances is arbitrary

Specified by:
cancelAllForActivity in interface ProcessInstanceModificationBuilder
Parameters:
activityId - the activity for which all instances should be cancelled

startBeforeActivity

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

Submits the instruction:

Start before the specified activity.

In particular:

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

startBeforeActivity

public ProcessInstanceModificationInstantiationBuilder startBeforeActivity(String activityId,
                                                                           String ancestorActivityInstanceId)
Description copied from interface: ProcessInstanceModificationBuilder

Submits the instruction:

Start before the specified activity. Instantiate the given activity as a descendant of the given ancestor activity instance.

In particular:

Specified by:
startBeforeActivity in interface ProcessInstanceModificationBuilder
Parameters:
activityId - the activity to instantiate
ancestorActivityInstanceId - the ID of an existing activity instance under which the new activity instance should be created

startAfterActivity

public ProcessInstanceModificationInstantiationBuilder 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<ProcessInstanceModificationInstantiationBuilder>
Parameters:
activityId - the activity for which the outgoing flow should be executed

startAfterActivity

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

Specified by:
startAfterActivity in interface ProcessInstanceModificationBuilder
Parameters:
activityId - the activity for which the outgoing flow should be executed

startTransition

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

Submits the instruction:

Start a sequence flow.

In particular:

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

startTransition

public ProcessInstanceModificationInstantiationBuilder startTransition(String transitionId,
                                                                       String ancestorActivityInstanceId)
Description copied from interface: ProcessInstanceModificationBuilder

Submits the instruction:

Start the specified sequence flow. Instantiate the given sequence flow as a descendant of the given ancestor activity instance.

In particular:

Specified by:
startTransition in interface ProcessInstanceModificationBuilder
Parameters:
transitionId - the sequence flow to execute
ancestorActivityInstanceId - the ID of an existing activity instance under which the new transition should be executed

getCurrentInstantiation

protected AbstractInstantiationCmd getCurrentInstantiation()

setVariable

public ProcessInstanceModificationInstantiationBuilder setVariable(String name,
                                                                   Object value)
Description copied from interface: ActivityInstantiationBuilder
If an instruction is submitted before then the variable is set when the instruction is executed. Otherwise, the variable is set on the process instance itself.

Specified by:
setVariable in interface ActivityInstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>

setVariableLocal

public ProcessInstanceModificationInstantiationBuilder setVariableLocal(String name,
                                                                        Object value)
Description copied from interface: ActivityInstantiationBuilder
If an instruction is submitted before then the local variable is set when the instruction is executed. Otherwise, the variable is set on the process instance itself.

Specified by:
setVariableLocal in interface ActivityInstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>

setVariables

public ProcessInstanceModificationInstantiationBuilder setVariables(Map<String,Object> variables)
Description copied from interface: ActivityInstantiationBuilder
If an instruction is submitted before then all variables are set when the instruction is executed. Otherwise, the variables are set on the process instance itself.

Specified by:
setVariables in interface ActivityInstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>

setVariablesLocal

public ProcessInstanceModificationInstantiationBuilder setVariablesLocal(Map<String,Object> variables)
Description copied from interface: ActivityInstantiationBuilder
If an instruction is submitted before then all local variables are set when the instruction is executed. Otherwise, the variables are set on the process instance itself.

Specified by:
setVariablesLocal in interface ActivityInstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>

execute

public void execute()
Description copied from interface: ProcessInstanceModificationBuilder
Execute all instructions. Custom execution and task listeners, as well as task input output mappings are executed.

Specified by:
execute in interface ProcessInstanceModificationBuilder

execute

public void execute(boolean skipCustomListeners,
                    boolean skipIoMappings)
Specified by:
execute in interface ProcessInstanceModificationBuilder
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

getCommandExecutor

public CommandExecutor getCommandExecutor()

getCommandContext

public CommandContext getCommandContext()

getProcessInstanceId

public String getProcessInstanceId()

getModificationOperations

public List<AbstractProcessInstanceModificationCommand> getModificationOperations()

isSkipCustomListeners

public boolean isSkipCustomListeners()

isSkipIoMappings

public boolean isSkipIoMappings()

setSkipCustomListeners

public void setSkipCustomListeners(boolean skipCustomListeners)

setSkipIoMappings

public void setSkipIoMappings(boolean skipIoMappings)

getProcessVariables

public org.camunda.bpm.engine.variable.VariableMap getProcessVariables()


Copyright © 2016 camunda services GmbH. All rights reserved.