Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ProcessStart

Callable

  • The method you invoke to begin an asynchronous process.

    example
    const actions = [
    process.action('a', () => console.log('a')),
    process.action('b', () => console.log('b')),
    process.action('c', () => console.log('c')),
    ];

    const deps = process.dependencies({ 'b': ['a', 'c'] });
    const trans = process.transitions([ ['a', 'c'], ['c', 'b']]);

    const dispatch = process.create('workflow', actions, deps);
    const start = process.create('state machine', actions, trans);

    const workflowPromise = dispatch('arg 1', 'arg 2');
    const machinePromise = start('a', { condition: 'value' });

    Parameters

    • Rest ...args: any[]

      The arguments to invoke the process with. Which arguments you pass will depend on the ProcessLogic instance you passed to process.

    Returns ExecutionPromise<Record<string, any>>

    A Promise that will be resolved or rejected based on the process' running actions. In addition to typical Promise methods, a few additional methods have been added to this instance to interact with the running process.