-
Notifications
You must be signed in to change notification settings - Fork 48
Home
ralphhanna edited this page Dec 19, 2023
·
5 revisions
- Service Task
- Script Task
- Conditional Flow
- Input Fields
- Multiple Start Event
- Business Rule Task
- Script Extensions
- Timer Event
- Multi-instances Tasks
- SubProcess
- Call Process
- Message Flow
- Throwing and Cathcing Messages
- Input and Output Data Handling
- Gateway
- Event Based Gateway
- Boundary Events
- UserTask Assignment
- engine BPMN Execution Engine
- definitions
- dataStore
- cache
- cron
The execution Engine , processes an BPMN definition - Engine
Method | parameters | return | description |
---|---|---|---|
start | name, input | ExecutionContext | - Start a new Process execution |
invoke | itemQuery ,input | ExecutionContext | Invoke an already started Item (waiting) |
signal | signalId,input | ExecutionContext | Issue a signal or message |
get | instanceQuery | Instance | Get an already running or idle Instance |
examples:
let response: executioncontext;
let data = {};
// engine
response = await bpmn.engine.start('SubProcess');
response = await bpmn.engine.invoke(itemQuery, data);
response = await bpmn.engine.signal(signalId, data);
response = await bpmn.engine.startEvent(instanceQuery, 'elementId', data);
response = await bpmn.engine.get(instanceQuery);
Manages BPMN defintions - Definitions
Method | parameters | return | description |
---|---|---|---|
list | - | string[] | |
load | name | definition |
Saves and retrievs Instances Data - DataStore
Method | parameters | return | description |
---|---|---|---|
findInstances | instanceQuery | Instance[] | |
findItems | itemQuery | Item[] |
Caches running instances for performance - CacheManager
list id[]
get instance
remove
clear
restart
Manages background tasks, primarly timers - Cron
start
check
stop
The syntax follows MongoDB standards, since instance data is saved in the format of :
{
id;
name;
//.. other instance attributes
items: { // items here
id;
elementId;
status;
// items here
}
data: { // data attributes here}
}
the query syntax must be
- instance attributes unqualified
- item attributes are qualified by 'items.<attributeName>'
- data attributes are qualified by 'data.<attributeName>'
example | will retrieve |
---|---|
{ "items.id": item.id } | find items by id only - unique |
{ id: instanceId, "items.elementId": item.elementId } | find items by instance id and elementId |
{"data.caseId": caseId ,"items.elementId" : item.elementId } | find items by caseId and item elementId |
{ id: instanceId, "items.status": 'wait' } | check for items in "wait" |
{"items.status": 'wait' } | find all items that has "wait" status |
and('find items by item id only', async () => {
query = { "items.id": item.id };
items = await server.dataStore.findItems(query);
checkItem(items, { id: item.id });
});
and('find items by instance and item elemetnId ', async () => {
query = { id: instanceId, "items.elementId": item.elementId };
items = await server.dataStore.findItems(query);
checkItem(items, { id: item.id });
});
and('find items by caseId and item elementId ', async () => {
query = {"data.caseId": caseId ,"items.elementId" : item.elementId };
items = await server.dataStore.findItems(query);
checkItem(items, { id: item.id });
});
and('check for items "wait" ', async () => {
query = { id: instanceId, "items.status": 'wait' };
items = await server.dataStore.findItems(query);
checkItem(items, { status: 'wait' });
});
and('find instance by instance id only', async () => {
query = { id: response.execution.id };
instances = await server.dataStore.findInstances(query);
checkInstance(instances, { id: response.execution.id });
});
and('find instance by itemd id ', async () => {
query = {"items.id": item.id };
instances = await server.dataStore.findInstances(query);
checkInstance(instances, { id: response.execution.id });
});
and('find instance by caseId', async () => {
query = {
data: { caseId: caseId }};
instances = await server.dataStore.findInstances(query);
checkInstance(instances, { id: response.execution.id });
});
-
configuration
-
AppDelegate
-
Event Listener
-
Data