@atlas-engine/core.process_model_execution
The core package of the AtlasEngine. Handles the execution of BPMN process models.
Last updated 5 days ago by obivarg .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @atlas-engine/core.process_model_execution 
SYNC missed versions from official npm registry.

AtlasEngine Core - ProcessModel execution

The core.process_model_execution package handles the execution of ProcessModels.

It contains numerous services, handlers and facades to accomplish this task. The most important ones are explained below.

ExecuteProcessService

Whenever you want to start a new instance for a ProcessModel, this is the service you will need.

It contains the entire operative necessary for handling a ProcessModels' execution.

You can start a Process instance by simply calling its start method. If you want to wait until the Process has finished, call the startAndAwaitEndEvent method instead. If you want to wait until a specific EndEvent is reached, call the startAndAwaitSpecificEndEvent method.

ResumeProcessService

This service will retrieve all running ProcessInstances from the ProcessInstance repository and restart their execution.

This service is designed to be run only once, when you first startup the AtlasEngine.

It is not recommended, to use this service after the initial start!

FlowNodeHandler

The FlowNodeHandler is the base class for all handlers; it provides an abstract executeInternally method where the logic of the derived handlers is implemented.

The base class also offers a private hook named afterExecute, which is executed after each FlowNode instance has finished.

The ProcessTokenFacade contains all methods which implements common Tasks for FlowNode instances.

An example would be to store the current state of a process or exporting metrics.

FlowNodeHandlers

Each BPMN type has its own handler; these handlers are named after the respective type they are supposed to handle and are derived from the FlowNodeHandler base class.

The ExecuteProcessService will delegate the execution of each FlowNode instance to a matching FlowNodeHandler.

For example, a ScriptTask will be run by the ScriptTaskHandler, a ServiceTask by the ServiceTaskHandler, etc.

Mapping each BPMN type to a handler is done by the FlowNodeHandlerFactory.

FlowNodeHandlerFactory

The factory maps the various BPMN types to their respective handlers; it also creates handlers for any BoundaryEvent that may be attached to the FlowNode.

These additional handlers are attached to their parent handler by decorators.

Example:

Assuming we have a ScriptTask with two BoundaryEvents attached to it:

  • a TimerBoundaryEvent and
  • an ErrorBoundaryEvent.

In this scenario, three handlers will be created; calling execute on the returned handler will produce the following call stack:

  • TimerBoundaryEventHandler.execute
    • ErrorBoundaryEventHandler.execute
      • ScriptTaskHandler.execute

The order in which the BoundaryEvent handlers are chained to the original handler is also important.

In this case, the TimerBoundaryEventHandler has to start its timers as fast as possible.

If the ScriptTask encounters an error, the ErrorBoundaryEventHandler must have the ability to handle it and decide which FlowNode to execute next.

On the other hand, the ErrorBoundaryEventHandler would not want to handle an error that is related to the TimerBoundaryEvent.

The factory is build to prevent such conflicts. It does this, by making sure that each decorator is run before the actual FlowNode is executed.

ProcessTokenFacade

The ProcessTokenFacade manages the ProcessToken for the process that is currently being run. It allows each FlowNodeInstance to query information from the ProcessToken that is relevant for its specific UseCase.

This guarantees that each FlowNode instance only gets the information that it actually needs, instead of the entire ProcessToken history.

It performs the following tasks:

  • Store each FlowNode instance result, using the addResultForFlowNode method.

  • Split ProcessTokens, using getProcessTokenFacadeForParallelBranch.

  • Merge several ProcessTokens together, using mergeTokenHistory.

  • For backwards compatibility:

    • get a ProcessToken in the old format, using getOldTokenFormat.

      This will provide you with a structure that resembles the old token.current/token.history structure.

ProcessModelFacade

The ProcessModelFacade provides access to the elements of a given ProcessModel. These elements can be FlowNodes, SequenceFlows or any other object that is contained within the ProcessModel.

A FlowNode instance, for example, can use this Facade to determine the FlowNode that is to be executed next.

Or a Split-Gatewaycan use it to find its correspondingJoin-Gateway`.

SubProcessModelFacade

The SubProcessModelFacade provides access to the elements of a given SubProcess.

It is created, using the parent process' ProcessModelFacade. This allows the SubProcess to access its parent ProcessModel as well.

The SubProcessModelFacade implements the same IProcessModelFacade interface as the ProcessModelFacade.

This allows for the SubProcessModelFacade to be be passed through to the handlers, without them knowing they're executed inside a SubProcess.

Because of this, the SubProcesssModelFacade can be passed to the individual handlers, without them knowing that their are executed inside a SubProcess.

Current Tags

  • 0.4.21                                ...           latest (5 days ago)

57 Versions

  • 0.4.21                                ...           5 days ago
  • 0.4.20                                ...           5 days ago
  • 0.4.19                                ...           6 days ago
  • 0.4.18                                ...           7 days ago
  • 0.4.17                                ...           7 days ago
  • 0.4.16                                ...           7 days ago
  • 0.4.15                                ...           7 days ago
  • 0.4.14                                ...           12 days ago
  • 0.4.13                                ...           13 days ago
  • 0.4.12                                ...           20 days ago
  • 0.4.11                                ...           20 days ago
  • 0.4.10                                ...           21 days ago
  • 0.4.9                                ...           a month ago
  • 0.4.8                                ...           a month ago
  • 0.4.7                                ...           a month ago
  • 0.4.6                                ...           a month ago
  • 0.4.5                                ...           a month ago
  • 0.4.4                                ...           a month ago
  • 0.4.3                                ...           a month ago
  • 0.4.2                                ...           a month ago
  • 0.4.1                                ...           a month ago
  • 0.4.0                                ...           a month ago
  • 0.3.10 [deprecated]           ...           a month ago
  • 0.3.9 [deprecated]           ...           a month ago
  • 0.3.8 [deprecated]           ...           a month ago
  • 0.3.7 [deprecated]           ...           a month ago
  • 0.3.6 [deprecated]           ...           a month ago
  • 0.3.5 [deprecated]           ...           a month ago
  • 0.3.4 [deprecated]           ...           a month ago
  • 0.3.3 [deprecated]           ...           a month ago
  • 0.3.2 [deprecated]           ...           a month ago
  • 0.3.1 [deprecated]           ...           2 months ago
  • 0.3.0 [deprecated]           ...           2 months ago
  • 0.2.9 [deprecated]           ...           2 months ago
  • 0.2.8 [deprecated]           ...           2 months ago
  • 0.2.7 [deprecated]           ...           2 months ago
  • 0.2.6 [deprecated]           ...           2 months ago
  • 0.2.5 [deprecated]           ...           2 months ago
  • 0.2.4 [deprecated]           ...           2 months ago
  • 0.2.3 [deprecated]           ...           2 months ago
  • 0.2.2 [deprecated]           ...           2 months ago
  • 0.2.1 [deprecated]           ...           2 months ago
  • 0.2.0 [deprecated]           ...           3 months ago
  • 0.1.13 [deprecated]           ...           3 months ago
  • 0.1.12 [deprecated]           ...           3 months ago
  • 0.1.11 [deprecated]           ...           3 months ago
  • 0.1.10 [deprecated]           ...           3 months ago
  • 0.1.9 [deprecated]           ...           3 months ago
  • 0.1.8 [deprecated]           ...           3 months ago
  • 0.1.7 [deprecated]           ...           3 months ago
  • 0.1.6 [deprecated]           ...           3 months ago
  • 0.1.5 [deprecated]           ...           3 months ago
  • 0.1.4 [deprecated]           ...           3 months ago
  • 0.1.3 [deprecated]           ...           3 months ago
  • 0.1.2 [deprecated]           ...           3 months ago
  • 0.1.1 [deprecated]           ...           3 months ago
  • 0.1.0 [deprecated]           ...           3 months ago
Downloads
Today 0
This Week 0
This Month 127
Last Day 0
Last Week 103
Last Month 354
Dev Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |