Class MultiInstanceScopeStrategy

All Implemented Interfaces:
GeneratorStrategy

public class MultiInstanceScopeStrategy extends DefaultHandlerStrategy
Special strategy for multi instance scopes.
  • Constructor Details

  • Method Details

    • applyHandler

      public void applyHandler(com.squareup.javapoet.MethodSpec.Builder methodBuilder)
      Description copied from interface: GeneratorStrategy
      Adds 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:
      applyHandler in interface GeneratorStrategy
      Overrides:
      applyHandler in class DefaultHandlerStrategy
      Parameters:
      methodBuilder - The method builder to use.
    • buildHandlerMethodJavadoc

      protected com.squareup.javapoet.CodeBlock buildHandlerMethodJavadoc()
      Overrides:
      buildHandlerMethodJavadoc in class DefaultHandlerStrategy
    • getHandlerType

      public com.squareup.javapoet.TypeName getHandlerType()
      Description copied from interface: GeneratorStrategy
      Returns the type name of the related handler or Void, if the activity is not handled by a specific handler.
      Specified by:
      getHandlerType in interface GeneratorStrategy
      Overrides:
      getHandlerType in class DefaultStrategy
      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: GeneratorStrategy
      Adds code, which asserts that the process instance has passed an activity.
      Specified by:
      hasPassed in interface GeneratorStrategy
      Overrides:
      hasPassed in class DefaultStrategy
      Parameters:
      methodBuilder - The method builder to use.
    • initHandlerStatement

      public com.squareup.javapoet.CodeBlock initHandlerStatement()
      Description copied from interface: GeneratorStrategy
      Returns the statement that initializes the handler.
       new UserTaskHandler(getProcessEngine(), "approveUserTask");
       
      Specified by:
      initHandlerStatement in interface GeneratorStrategy
      Overrides:
      initHandlerStatement in class DefaultHandlerStrategy
      Returns:
      The code.
    • isWaitingAt

      public void isWaitingAt(com.squareup.javapoet.MethodSpec.Builder methodBuilder)
      Description copied from interface: GeneratorStrategy
      Adds code, which asserts that the process instance is waiting at an activity.
      Specified by:
      isWaitingAt in interface GeneratorStrategy
      Overrides:
      isWaitingAt in class DefaultStrategy
      Parameters:
      methodBuilder - The method builder to use.