Interface ObjectWorkflow


public interface ObjectWorkflow
This is the interface to define an object workflow definition. ObjectWorkflow is a top level concept in iWF. Any object that is long-lasting(at least a few seconds) can be modeled as an "ObjectWorkflow".
  • Method Details

    • getWorkflowStates

      default List<StateDef> getWorkflowStates()
      defines the states of the workflow. A state represents a step of the workflow state machine. A state can execute some commands (signal/timer) and wait for result See more details in the WorkflowState definition. By default, this return an empty list, meaning no states. There can be at most one startingState in the list. If there is no startingState or with the default empty state list, the workflow will not start any state execution after workflow stated. However, application code can still use RPC to invoke new state execution in the future.
      Returns:
      all the state definitions
    • getPersistenceSchema

      default List<PersistenceFieldDef> getPersistenceSchema()
      defines all the persistence fields for this workflow, this includes: 1. Data attributes 2. Search attributes

      Data attributes can be read/upsert in WorkflowState start/decide API Data attributes can also be read by RPC/GetDataAttributes API by external applications using Client

      Search attributes can be read/upsert in WorkflowState start/decide API Search attributes can also be read by RPC/GetSearchAttributes Client API by external applications External applications can also use "SearchWorkflow" API to find workflows by SQL-like query

      Returns:
      the persistence schema
    • getPersistenceOptions

      default PersistenceOptions getPersistenceOptions()
    • getCommunicationSchema

      default List<CommunicationMethodDef> getCommunicationSchema()
      defines all the communication methods for this workflow, this includes 1. Signal channel 2. Interstate channel

      Signal channel is for external applications to send signal to workflow execution. Workflow execution can listen on the signal in the WorkflowState start API and receive in the WorkflowState decide API

      InternalChannel is for synchronization communications within the workflow execution internally. E.g. WorkflowStateA will continue after receiving a value from WorkflowStateB, or from an RPC

      Returns:
      the communication schema
    • getWorkflowType

      default String getWorkflowType()
      Define the workflowType of this workflow definition. By default, it's the simple name of the workflow instance, which should be the case for most scenarios.

      Implement this to provide a different workflowType than default to avoid breaking changes when changing workflow class name. However, Client must then use String to provide workflow type to start workflows.

      Returns:
      the workflow type