Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Simulation Support / Scripting

Use the simulation-support module to drive and introspect a token simulation instance via API.

Simulation Screen Capture

Features

  • Record and assert the trace of execution
  • Toggle pause and resume
  • Await element enter and exit
  • Trigger event / continue execution

Usage

Driver and introspection capabilities are hooked up via the simulation-support module:

import SimulationSupportModule from 'bpmn-js-token-simulation/lib/simulation-support';

const modeler = new BpmnModeler({
  additionalModules: [
    ...,
    SimulationSupportModule
  ]
});

The SimulationSupport service exposed by the module provides all relevant APIs:

const simulationSupport = modeler.get('simulationSupport');

// enable simulation
simulationSupport.toggleSimulation(true);

// toggle pause on activity
simulationSupport.triggerElement('UserTask_1');

// start simulation
simulationSupport.triggerElement('StartEvent_1');

await simulationSupport.elementEnter('UserTask_1');

window.alert('WANT ME TO CONTINUE?');

// trigger un-pause
simulationSupport.triggerElement('UserTask_1');