@mingsterism/simulator
v1.2.2
Published
This TypeScript-based simulator models a business process using event-driven architecture. It's designed to simulate various processes based on provided templates and handles parallel and exclusive gateway nodes, including approval/decision nodes, which a
Downloads
1
Readme
Process Simulator
This TypeScript-based simulator models a business process using event-driven architecture. It's designed to simulate various processes based on provided templates and handles parallel and exclusive gateway nodes, including approval/decision nodes, which are essential components in business process modeling.
Setup
To set up the simulator, follow these steps:
Install the dependencies:
npm install
For testing, select one of the four different process templates from
example_processes.ts
, and run the tests to simulate the business process:npm run test
Features
- Event-Driven Architecture: Uses an event-driven approach to model the flow of the business process.
- Gateway Nodes: Supports both parallel and exclusive gateway nodes (including approval/decision nodes) to replicate complex business logic.
- Loopback Handling: Throws an error if a loopback scenario is detected; currently unable to simulate processes with loopback scenarios.
Structure
The Simulator is located in the src/
directory. It contains the following files:
- main.ts: Contains the process simulator.
- utils.ts: Contains the helper functions of the simulator.
- types.ts: Contains data types used in the simulator and helper functions.
- example_processes.ts: Contains four different types of process templates for testing.
- test.ts: A playground for simulating different process templates.
Configuration
You can configure the Simulator by modifying the files in the src/
directory. The core function is simulateNode
in utils.ts
, which is responsible for simulating the metrics of a single node and recursively processing subsequent nodes to provide a live simulation of the entire process. By adjusting the parameters and logic within this function, you can tailor the simulation to fit specific business process requirements.