Skip to content

Process Overview

Quanzheng Long edited this page Sep 25, 2023 · 3 revisions
  • Process is top level concept of the programming model(just like "Workflow" in iWF or other workflow engines). It contains all other elements including business data and logic. All is defined as code using developers' native programming languages.
    • ProcessExecution: an execution of a process.
    • Persistence: the data that will be accessible during the execution of the process, by AsyncState and RPC.
      • LocalAttribute: the data that only lives during the lifetime of a single ProcessExecution.
      • GlobalAttribute: the data that lives over the lifetime of a ProcessExecution, and shared across and multiple ProcessExecutions
    • Communication:
      • LocalQueue: a message queue that will be accessed during the execution of the process
      • GlobalQueue: a message queue that lives over the lifetime of a ProcessExecution, and shared across and multiple ProcessExecutions
    • AsyncState: A business logic unit to be invoked by XDB server and running asynchronously.
      • WaitUntil Method: an optional method for developer to implement, which returns a CommandRequest to tell XDB service to wait for something. It is invoked by XDB service and executed in worker.
        • CommandRequest: An object returned from WaitUntil to tell XDB what commands to wait for
          • TimerCommand: A command to wait for a durable timer to fire
          • LocalQueueCommand: A command to wait for some messages to consume in LocalQueue
          • GlobalQueueCommand: A command to wait for some messages to consume in GlobalQueue
          • WaitingType: because a command request could return a list of commands, waiting type will tell how to wait for the combination of them (allOf, AnyOf or more complex combination of Any and All)
      • Execute Method: a required method for developer to implement, which returns a StateDecision to tell what is next. It is invoked by XDB service and executed in worker.
        • StateDecision: A StateDecision can be:
          • Going to single next AsyncState as sequenced steps in single thread
          • Going to multiple next AsyncState as in-parallel threads
          • Complete/fail the ProcessExecution
          • DeadEnd as just stopping the current thread only
    • RPC: A business logic unit as an interface of the ProcessExecution. It's invoked by client and executed in worker. But different from AsyncState, it's synchronously executing so that it can return to the client calls.
      • RPC can have same access to Persistence, LocalQueue and GlobalQueue, and even start new threads of AsyncState.

Below is the concept hierarchy diagram:

Screenshot 2023-09-24 at 7 10 02 PM
Clone this wiki locally