Showing posts with label JBPM Architecture. Show all posts
Showing posts with label JBPM Architecture. Show all posts

Dec 26, 2007

JBPM Architecture Continued !!


Action Handlers are contained in process definition and are executed in JBPM engine.When the process engine encounter a node during the execution of process instance which is derived from process definition, action handler associated with them are executed. Action handlers are instances of Java code that interact with external systems when executed.

Process Definition: A process definition is based on a directed graph (A ProcessDefinition is formal description of process represented as Java Objects). The graph is composed of nodes, transitions, one start state, and one end state. The type of each node defines the runtime behavior for the node. While a process definition executes, the following entities come into play:
Process instance: A process instance is one execution of a process definition. When a process instance is created a token is created for main path of execution called the "Root Token" and is positioned and the start state of the Process Definition.
ProcessInstance processInstance = new ProcessInstance (processDefinition);


Token: A token is one path of execution. A token is the runtime concept that maintains a pointer to a node in the graph.
Token token = processInstance.getRootToken ();

Signal: A signal instructs a token to continue graph execution by transition out of a node.When receiving an unnamed signal, the token will leave its current node over the default leaving transition. When a transition-name is specified in the signal, the token will leave its node over the specified transition. A signal given to the process instance is delegated to the root token.
token.signal ();

Node: Nodes are responsible for the continuation of a graph execution. When a token enters a node, the node executes. Node type determine what will happen when execution arrives at a particular node.A node that does not propagate execution is regarded as a state.
Action: Actions are instances of Java code executed when events occur in a process execution. The primary event types are "entering a node," "leaving a node”, and "taking a transition."

Overview of JBOSS JBPM Architecture

JBoss jBPM defines process definitions within files written using the JBoss process definition language e.g jPDL. JPDL is a graphic-oriented programming (GOP) language based on a model of nodes, transitions, and actions. In this model, nodes are traversed and executed as they are encountered during the flow of a process definition. Transitions direct the flow of execution of a process definition, and actions perform specific logic as a node or transition event occurs.
In jBPM, process definitions are packaged as process archives, when process definition is created using Process designer ".par" file is created. A process archive is passed to the JBPM process engine for execution. The JBPM runtime engine traverses a process graph (which is always a directed graph) and executes actions defined with various transitions and states or nodes.
JBoss jBPM mainly consists of following components.

Runtime engine: This component executes process actions, maintains process state, and logs all process events via the following components:

  1. A request handler
  2. A state manager
  3. A log manager
  4. A definition loader
  5. An execution service
Process monitor: There are various modules in JBPM one of them is Process monitor, which is responsible for auditing and logging.
Process language: The process definition language (jPDL) is based on GOP which is easier to use and can keep business and programmer on same page. Business can create the Graph (More or less like flowchart) and developer can implement the logic.
Interaction services: These services expose legacy applications as functions or data to be used in process executions