alpha-bpm-interfaces
v0.2.2
Published
alpha bpm interfaces Library is a TypeScript library that provides a set of interfaces for interacting with BPM (Business Process Management) systems. It is designed to offer a uniform interface for different BPM engines, making it easier to develop BPM-r
Readme
alpha-bpm-interfaces Library
alpha bpm interfaces Library is a TypeScript library that provides a set of interfaces for interacting with BPM (Business Process Management) systems. It is designed to offer a uniform interface for different BPM engines, making it easier to develop BPM-related applications.
Installation
You can install this package using npm:
npm install alpha-bpm-interfacesUsage
To use this library in your TypeScript project, follow these steps:
Install the package using npm:
npm install alpha-bpm-interfacesImport the provided interfaces and extend them as needed in your TypeScript code:
import { BpmService} from "alpha-bpm-interfaces"; import { ProcessInstance,TaskDefinition,TaskInstance,ProcessDefinition} from "alpha-bpm-interfaces/dist/InstanceInterfaces"; class MyBpmService implements BpmService { getProcessDefinitions(processName: string, version: string): ProcessDefinition { // Your implementation here return ProcessInstance } // Implement other abstract methods } const myService = new MyBpmService()
Methods
| Method Name | Description | Parameters | Return Type |
|--------------------------|------------------------------------------------------|--------------------------------------------------|----------------|
| getAllProcessDefinitions | Get All process definiton | options(ProcessOptions), metadata(string) | ProcessDefinition[] |
| getProcessDefinition | Get process definitions for a given process | processDefinitionId(string), metadata(Record<string, any>), processName?(string), version?(string) | ProcessDefinition |
| getAllTaskDefinition | Get All task definition for a given process | processDefinitionId(string), metadata(Record<string, any>) | TaskDefinition[] |
| startProcess | Start a new process instance | processDefinitionId(string), variables(Record<string, any>), metadata(Record<string, any>) | ProcessInstance["porcessInstanceId"] |
| abortProcess | Stop a running process instance | processInstanceId(string), metadata(Record<string, any>) | void |
| getAllProcessInstances | Get all process Instances | options(ProcessOptions), metadata(Record<string, any>) | ProcessInstance[] |
| getProcessInstance | Get information about a specified process instance | processInstanceId(string), metadata(Record<string, any>) | ProcessInstance |
| getProcessVariables | Get variables associated with a process instance | processInstanceId(string), metadata(Record<string,any>) | ProcessInstance["processVariables"] |
| setProcessVariables | Set variables for a process instance | processInstanceId(string), variables(Record<string, any>), metadata(Record<string,any>) | void |
| getAllUserAssignedTasks | Get tasks for a process instance for potential owners or owner | userName(string), options(TaskOptions) | TaskInstance[] |
| getAllTasks | Get all task instances | options(TaskOptions) | TaskInstance[] |
| completeTask | Complete a task for a process instance | taskId(string), metadata(Record<string, any>) | void |
| assignTask | Assign a task to a user | taskId(string), user(string), metadata(Record<string, any>) | void |
| sendSignal | Signals a specified process instance with a specified signal | processInstanceId(string), signalName(string), metadata(Record<string, any>) | void |
Instance Interfaces
| Interface Name | Properties |
|----------------------|-------------------------------------------------------|
| ProcessDefinition | - processName (string) |
| | - processVersion (string) |
| | - processDefinitionId (string) |
| | - metadata (Record<string, any>) |
| | - taskDefinitions (TaskDefinition) |
| TaskDefinition | - taskName (string) |
| | - taskType (string) |
| | - metadata (Record<string, any>) |
| ProcessInstance | - processName (string) |
| | - processVersion (string) |
| | - processVariables (Record<string, any>) |
| | - processStatus ('STARTED' / 'COMPLETED' / 'SUSPENDED' / 'ABORTED' / 'FAILED') |
| | - processInstanceId (string) |
| | - processDefinitionId (string) |
| | - parentProcessInstanceId? (string) |
| | - startedBy? (string) |
| | - startTime (Date) |
| | - endTime? (Date) |
| | - metadata (Record<string, any>) |
| TaskInstance | - taskId (string) |
| | - taskName (string) |
| | - taskStatus (TaskOptions["status"]) |
| | - currentProcessInstanceId (string) |
| | - parentProcessInstanceId (string) |
| | - taskProcessDefinitionId (string) |
| | - metadata (Record<string, any>) |
| ProcessOptions | - status? (ProcessInstance["processStatus"]) |
| | - pageNumber? (number) |
| | - pageSize? (number) |
| TaskOptions | - status? ('CREATED' / 'READY' / 'RESESRVED' / 'INPROGRESS' / 'SUSPENDED' / 'COMPLETED' / 'FAILED' / 'ERROR' / 'EXITED' / 'OBSOLETE') |
| | - group? (string) |
| | - user (string) |
| | - pageNumber? (number) |
| | - pageSize? (number) |
