Package org.camunda.bpm.scenario.impl
Class ProcessRunnerImpl
- java.lang.Object
-
- org.camunda.bpm.scenario.impl.AbstractRunner
-
- org.camunda.bpm.scenario.impl.ProcessRunnerImpl
-
- All Implemented Interfaces:
ProcessRunner,ProcessRunner.ExecutableRunner,ProcessRunner.ExecutableRunner.StartingByKey,ProcessRunner.ExecutableRunner.StartingByMessage,ProcessRunner.ExecutableRunner.StartingByStarter,ProcessRunner.StartableRunner,Runner
- Direct Known Subclasses:
MockedProcessRunnerImpl
public class ProcessRunnerImpl extends AbstractRunner implements ProcessRunner.ExecutableRunner.StartingByKey, ProcessRunner.ExecutableRunner.StartingByMessage, ProcessRunner.StartableRunner, ProcessRunner.ExecutableRunner.StartingByStarter, ProcessRunner
- Author:
- Martin Schimak
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.camunda.bpm.scenario.run.ProcessRunner
ProcessRunner.ExecutableRunner, ProcessRunner.StartableRunner
-
Nested classes/interfaces inherited from interface org.camunda.bpm.scenario.run.ProcessRunner.ExecutableRunner
ProcessRunner.ExecutableRunner.StartingByKey, ProcessRunner.ExecutableRunner.StartingByMessage, ProcessRunner.ExecutableRunner.StartingByStarter
-
-
Constructor Summary
Constructors Constructor Description ProcessRunnerImpl(ScenarioImpl scenarioExecutor, ProcessScenario scenario)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.camunda.bpm.engine.ProcessEngineengine()ProcessRunner.ExecutableRunnerengine(org.camunda.bpm.engine.ProcessEngine processEngine)Provide a custom process engine to the scenario run.Scenarioexecute()Execute the fully defined scenario run.ProcessRunner.ExecutableRunner.StartingByKeyfromAfter(String activityId)Run the new process instance not from its beginning, but just from after the activity id provided as parameter.ProcessRunner.ExecutableRunner.StartingByKeyfromBefore(String activityId)Run the new process instance not from its beginning, but just from before the activity id provided as parameter.StringgetProcessDefinitionKey()booleanisExecuted(org.camunda.bpm.engine.history.HistoricActivityInstance instance)List<Executable>next()org.camunda.bpm.engine.runtime.ProcessInstancerun()ProcessRunner.StartableRunnerrun(ProcessScenario scenario)Run another new process instance by means of the scenario interface provided as parameter.voidrunning(CallActivityExecutable executable)voidsetExecuted()voidsetExecuted(WaitstateExecutable waitstate)ProcessRunner.ExecutableRunner.StartingByStarterstartBy(ProcessStarter scenarioStarter)Start the new process instance by means of custom code.ProcessRunner.ExecutableRunner.StartingByKeystartByKey(String processDefinitionKey)Start the new process instance by providing a process definition key.ProcessRunner.ExecutableRunner.StartingByKeystartByKey(String processDefinitionKey, String businessKey)Start the new process instance by providing a process definition key, business key and provide a few process instance variables.ProcessRunner.ExecutableRunner.StartingByKeystartByKey(String processDefinitionKey, String businessKey, Map<String,Object> variables)Start the new process instance by providing a process definition key, business key and provide a few process instance variables.ProcessRunner.ExecutableRunner.StartingByKeystartByKey(String processDefinitionKey, Map<String,Object> variables)Start the new process instance by providing a process definition key and provide a few process instance variables.ProcessRunner.ExecutableRunner.StartingByMessagestartByMessage(String messageName)Start the new process instance by providing a message name.ProcessRunner.ExecutableRunner.StartingByMessagestartByMessage(String messageName, Map<String,Object> variables)Start the new process instance by providing a message name and provide a few process instance variables.ProcessRunner.StartableRunnerwithMockedProcess(String processDefinitionKey)Mock the scenario by deploying a process with the given process definition key, but only a single wait state to interact with (internally implemented with an external task).
-
-
-
Constructor Detail
-
ProcessRunnerImpl
public ProcessRunnerImpl(ScenarioImpl scenarioExecutor, ProcessScenario scenario)
-
-
Method Detail
-
startBy
public ProcessRunner.ExecutableRunner.StartingByStarter startBy(ProcessStarter scenarioStarter)
Description copied from interface:ProcessRunner.StartableRunnerStart the new process instance by means of custom code. Implement the ProcessStarter.start() method to create a process instance.- Specified by:
startByin interfaceProcessRunner.StartableRunner- Parameters:
scenarioStarter- interface which delivers a new process instance
-
startByKey
public ProcessRunner.ExecutableRunner.StartingByKey startByKey(String processDefinitionKey)
Description copied from interface:ProcessRunner.StartableRunnerStart the new process instance by providing a process definition key.- Specified by:
startByKeyin interfaceProcessRunner.StartableRunner- Parameters:
processDefinitionKey- to be used to start a process instance
-
startByKey
public ProcessRunner.ExecutableRunner.StartingByKey startByKey(String processDefinitionKey, Map<String,Object> variables)
Description copied from interface:ProcessRunner.StartableRunnerStart the new process instance by providing a process definition key and provide a few process instance variables.- Specified by:
startByKeyin interfaceProcessRunner.StartableRunner- Parameters:
processDefinitionKey- to be used to start a process instancevariables- to be used as process instance variables from the start on.
-
startByKey
public ProcessRunner.ExecutableRunner.StartingByKey startByKey(String processDefinitionKey, String businessKey, Map<String,Object> variables)
Description copied from interface:ProcessRunner.StartableRunnerStart the new process instance by providing a process definition key, business key and provide a few process instance variables.- Specified by:
startByKeyin interfaceProcessRunner.StartableRunner- Parameters:
processDefinitionKey- to be used to start a process instancebusinessKey- to be used to start a process by business keyvariables- to be used as process instance variables from the start on.
-
startByKey
public ProcessRunner.ExecutableRunner.StartingByKey startByKey(String processDefinitionKey, String businessKey)
Description copied from interface:ProcessRunner.StartableRunnerStart the new process instance by providing a process definition key, business key and provide a few process instance variables.- Specified by:
startByKeyin interfaceProcessRunner.StartableRunner- Parameters:
processDefinitionKey- to be used to start a process instancebusinessKey- to be used to start a process by business key
-
startByMessage
public ProcessRunner.ExecutableRunner.StartingByMessage startByMessage(String messageName)
Description copied from interface:ProcessRunner.StartableRunnerStart the new process instance by providing a message name.- Specified by:
startByMessagein interfaceProcessRunner.StartableRunner- Parameters:
messageName- to be used to start a process instance
-
startByMessage
public ProcessRunner.ExecutableRunner.StartingByMessage startByMessage(String messageName, Map<String,Object> variables)
Description copied from interface:ProcessRunner.StartableRunnerStart the new process instance by providing a message name and provide a few process instance variables.- Specified by:
startByMessagein interfaceProcessRunner.StartableRunner- Parameters:
messageName- to be used to start a process instancevariables- to be used as process instance variables from the start on.
-
fromBefore
public ProcessRunner.ExecutableRunner.StartingByKey fromBefore(String activityId)
Description copied from interface:ProcessRunner.ExecutableRunner.StartingByKeyRun the new process instance not from its beginning, but just from before the activity id provided as parameter.- Specified by:
fromBeforein interfaceProcessRunner.ExecutableRunner.StartingByKey- Parameters:
activityId- from before which the new process instance should be started
-
fromAfter
public ProcessRunner.ExecutableRunner.StartingByKey fromAfter(String activityId)
Description copied from interface:ProcessRunner.ExecutableRunner.StartingByKeyRun the new process instance not from its beginning, but just from after the activity id provided as parameter.- Specified by:
fromAfterin interfaceProcessRunner.ExecutableRunner.StartingByKey- Parameters:
activityId- from after which the new process instance should be started
-
run
public ProcessRunner.StartableRunner run(ProcessScenario scenario)
Description copied from interface:ProcessRunner.ExecutableRunnerRun another new process instance by means of the scenario interface provided as parameter. .- Specified by:
runin interfaceProcessRunner.ExecutableRunner- Parameters:
scenario- interface to be used for running the process instance
-
engine
public ProcessRunner.ExecutableRunner engine(org.camunda.bpm.engine.ProcessEngine processEngine)
Description copied from interface:ProcessRunner.ExecutableRunnerProvide a custom process engine to the scenario run. You just need to call it in case you ramp up more than one process engine during your tests.- Specified by:
enginein interfaceProcessRunner.ExecutableRunner- Parameters:
processEngine- to be used by the scenario run
-
withMockedProcess
public ProcessRunner.StartableRunner withMockedProcess(String processDefinitionKey)
Description copied from interface:ProcessRunner.StartableRunnerMock the scenario by deploying a process with the given process definition key, but only a single wait state to interact with (internally implemented with an external task).- Specified by:
withMockedProcessin interfaceProcessRunner.StartableRunner- Parameters:
processDefinitionKey- the process definition key to mock
-
execute
public Scenario execute()
Description copied from interface:ProcessRunner.ExecutableRunner.StartingByKeyExecute the fully defined scenario run.- Specified by:
executein interfaceProcessRunner.ExecutableRunner- Specified by:
executein interfaceProcessRunner.ExecutableRunner.StartingByKey- Specified by:
executein interfaceProcessRunner.ExecutableRunner.StartingByMessage- Specified by:
executein interfaceProcessRunner.ExecutableRunner.StartingByStarter- Returns:
- an executed scenario
-
engine
public org.camunda.bpm.engine.ProcessEngine engine()
-
getProcessDefinitionKey
public String getProcessDefinitionKey()
-
running
public void running(CallActivityExecutable executable)
-
run
public org.camunda.bpm.engine.runtime.ProcessInstance run()
-
next
public List<Executable> next()
- Specified by:
nextin classAbstractRunner
-
setExecuted
public void setExecuted()
-
setExecuted
public void setExecuted(WaitstateExecutable waitstate)
-
isExecuted
public boolean isExecuted(org.camunda.bpm.engine.history.HistoricActivityInstance instance)
-
-