Class POJOWorkflowImplMetadata

java.lang.Object
io.temporal.common.metadata.POJOWorkflowImplMetadata

public final class POJOWorkflowImplMetadata extends Object
Rules:
  • A workflow implementation must implement at least one non empty interface annotated with WorkflowInterface
  • An interface annotated with WorkflowInterface can extend zero or more interfaces.
  • An interface annotated with WorkflowInterface defines workflow methods for all methods it inherited from interfaces which are not annotated with WorkflowInterface.
  • Each method name can be defined only once across all interfaces annotated with WorkflowInterface. So if annotated interface A has method foo() and an annotated interface B extends A it cannot also declare foo() even with a different signature.
  • Method Details

    • newInstance

      public static POJOWorkflowImplMetadata newInstance(Class<?> implClass)
      Create POJOWorkflowImplMetadata for a workflow implementation class. The object must implement at least one workflow method. Validates the implementation can be registered.
    • newInstanceForWorkflowFactory

      public static POJOWorkflowImplMetadata newInstanceForWorkflowFactory(Class<?> implClass)
      Create POJOWorkflowImplMetadata for a workflow implementation class. The object must implement at least one workflow method. Does not validate the implementation can be registered.
    • newListenerInstance

      public static POJOWorkflowImplMetadata newListenerInstance(Class<?> implClass)
      Create POJOWorkflowImplMetadata for a workflow implementation class. The class may not implement any workflow method. This is to be used for classes that implement only query and signal methods.
    • getWorkflowInterfaces

      public List<POJOWorkflowInterfaceMetadata> getWorkflowInterfaces()
      List of workflow interfaces an object implements.
    • getWorkflowMethods

      public List<POJOWorkflowMethodMetadata> getWorkflowMethods()
      List of workflow methods an object implements across all the workflow interfaces.
    • getSignalMethods

      public List<POJOWorkflowMethodMetadata> getSignalMethods()
      List of signal methods an object implements across all the workflow interfaces.
    • getQueryMethods

      public List<POJOWorkflowMethodMetadata> getQueryMethods()
      List of query methods an object implements across all the workflow interfaces.
    • getUpdateMethods

      public List<POJOWorkflowMethodMetadata> getUpdateMethods()
      List of update methods an object implements across all the workflow interfaces.
    • getUpdateValidatorMethods

      public List<POJOWorkflowMethodMetadata> getUpdateValidatorMethods()
      List of update validator methods an object implements across all the workflow interfaces.
    • getWorkflowInit

      @Experimental @Nullable public Constructor<?> getWorkflowInit()
    • getVersioningBehaviorForMethod

      @Nullable public static VersioningBehavior getVersioningBehaviorForMethod(Class<?> implementationClass, POJOWorkflowMethodMetadata workflowMethod)
      Returns:
      The VersioningBehavior for the workflow method on the implementation class. If the method is annotated with WorkflowVersioningBehavior.
      Throws:
      RuntimeException - if the method is not found on the implementation class or is not a workflow method.