Class MultiInstanceScopeStrategy
java.lang.Object
org.camunda.community.bpmndt.strategy.DefaultStrategy
org.camunda.community.bpmndt.strategy.DefaultHandlerStrategy
org.camunda.community.bpmndt.strategy.MultiInstanceScopeStrategy
- All Implemented Interfaces:
GeneratorStrategy
Special strategy for multi instance scopes.
-
Field Summary
Fields inherited from class org.camunda.community.bpmndt.strategy.DefaultStrategy
activity, literal, multiInstanceParentFields inherited from interface org.camunda.community.bpmndt.GeneratorStrategy
CALL_ACTIVITY, EVENT, EXTERNAL_TASK, EXTERNAL_TASK_CLIENT, JOB, OTHER, RECEIVE_TASK, USER_TASK -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyHandler(com.squareup.javapoet.MethodSpec.Builder methodBuilder) Adds code to the execute/apply method, if the activity is handled by a handler and a wait state - e.g.:protected com.squareup.javapoet.CodeBlockcom.squareup.javapoet.TypeNameReturns the type name of the related handler orVoid, if the activity is not handled by a specific handler.voidhasPassed(com.squareup.javapoet.MethodSpec.Builder methodBuilder) Adds code, which asserts that the process instance has passed an activity.com.squareup.javapoet.CodeBlockReturns the statement that initializes the handler.voidisWaitingAt(com.squareup.javapoet.MethodSpec.Builder methodBuilder) Adds code, which asserts that the process instance is waiting at an activity.Methods inherited from class org.camunda.community.bpmndt.strategy.DefaultHandlerStrategy
addHandlerField, addHandlerMethod, getHandler, initHandlerMethods inherited from class org.camunda.community.bpmndt.strategy.DefaultStrategy
addHandlerFieldAfter, addHandlerFieldBefore, addHandlerMethodAfter, addHandlerMethodBefore, applyHandlerAfter, applyHandlerBefore, buildHandlerMethodName, equals, getActivity, getHandlerAfter, getHandlerBefore, getLiteral, getLiteralAfter, getLiteralBefore, hashCode, initHandlerAfter, initHandlerAfterStatement, initHandlerBefore, initHandlerBeforeStatement, setMultiInstanceParent, shouldHandleAfter, shouldHandleBefore
-
Constructor Details
-
MultiInstanceScopeStrategy
-
-
Method Details
-
applyHandler
public void applyHandler(com.squareup.javapoet.MethodSpec.Builder methodBuilder) Description copied from interface:GeneratorStrategyAdds code to the execute/apply method, if the activity is handled by a handler and a wait state - e.g.:assertThat(pi).isWaitingAt("placeOrderExternalTask"); instance.apply(placeOrderExternalTask)or the previous activity is an event based gateway.
- Specified by:
applyHandlerin interfaceGeneratorStrategy- Overrides:
applyHandlerin classDefaultHandlerStrategy- Parameters:
methodBuilder- The method builder to use.
-
buildHandlerMethodJavadoc
protected com.squareup.javapoet.CodeBlock buildHandlerMethodJavadoc()- Overrides:
buildHandlerMethodJavadocin classDefaultHandlerStrategy
-
getHandlerType
public com.squareup.javapoet.TypeName getHandlerType()Description copied from interface:GeneratorStrategyReturns the type name of the related handler orVoid, if the activity is not handled by a specific handler.- Specified by:
getHandlerTypein interfaceGeneratorStrategy- Overrides:
getHandlerTypein classDefaultStrategy- Returns:
- The handler type name e.g.
TypeName.get(UserTaskHandler.class).
-
hasPassed
public void hasPassed(com.squareup.javapoet.MethodSpec.Builder methodBuilder) Description copied from interface:GeneratorStrategyAdds code, which asserts that the process instance has passed an activity.- Specified by:
hasPassedin interfaceGeneratorStrategy- Overrides:
hasPassedin classDefaultStrategy- Parameters:
methodBuilder- The method builder to use.
-
initHandlerStatement
public com.squareup.javapoet.CodeBlock initHandlerStatement()Description copied from interface:GeneratorStrategyReturns the statement that initializes the handler.new UserTaskHandler(getProcessEngine(), "approveUserTask");
- Specified by:
initHandlerStatementin interfaceGeneratorStrategy- Overrides:
initHandlerStatementin classDefaultHandlerStrategy- Returns:
- The code.
-
isWaitingAt
public void isWaitingAt(com.squareup.javapoet.MethodSpec.Builder methodBuilder) Description copied from interface:GeneratorStrategyAdds code, which asserts that the process instance is waiting at an activity.- Specified by:
isWaitingAtin interfaceGeneratorStrategy- Overrides:
isWaitingAtin classDefaultStrategy- Parameters:
methodBuilder- The method builder to use.
-