0.4.35 • Published 1 month ago

@wooksjs/event-wf v0.4.35

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@wooksjs/event-wf

!!! This is work-in-progress library, breaking changes are expected !!!

The @wooksjs/event-wf is a component of the wooks event processing framework built on top of @prostojs/wf. It provides a way to manage complex workflows and processes using the underlying workflow engine.

The primary features of @wooksjs/event-wf include:

  • Support for conditional workflow branching based on dynamic conditions.
  • Support for parametric steps and workflows.
  • Support for user input requirements and interaction during the workflows.

Installation

To install @wooksjs/event-wf, you can use npm:

npm install wooks @wooksjs/event-wf

Quick Start

import { useRouteParams } from '@wooksjs/event-core'
import { createWfApp } from '@wooksjs/event-wf'

const app = createWfApp<{ result: number }>()

app.step('add', {
    input: 'number',
    handler: 'ctx.result += input',
})

app.step('add/:n', {
    handler: (ctx) => {
        ctx.result += Number(useRouteParams().get('n'))
    },
})

app.flow('adding', [
    { id: 'add', input: 5 },
    { id: 'add', input: 2 },
    {
        condition: 'result < 10',
        steps: [{ id: 'add', input: 3 }, { id: 'add', input: 4 }],
    },
])

app.flow('adding-parametric', [
    'add/5',
    'add/2',
    {
        condition: 'result < 10',
        steps: ['add/3', 'add/4'],
    },
])

app.run()

// Run the 'adding' workflow
app.start('adding', { result: 0 })

Documentation

For more detailed documentation, please visit wooks.moost.org.

Contributing

Contributions to the @wooksjs/event-wf project are welcome. If you find any bugs or have a feature request, please open an issue on the GitHub repository.

License

@wooksjs/event-wf is licensed under the MIT license.

0.4.35

1 month ago

0.4.33

1 month ago

0.4.34

1 month ago

0.4.31

1 month ago

0.4.32

1 month ago

0.4.30

2 months ago

0.4.28

3 months ago

0.4.29

3 months ago

0.4.27

3 months ago

0.4.26

3 months ago

0.4.25

3 months ago

0.4.24

4 months ago

0.4.23

4 months ago

0.4.22

4 months ago

0.4.20

4 months ago

0.4.21

4 months ago

0.4.19

4 months ago

0.4.18

4 months ago

0.4.17

4 months ago

0.4.15

4 months ago

0.4.16

4 months ago

0.4.14

4 months ago

0.4.13

5 months ago

0.4.12

5 months ago

0.4.10

5 months ago

0.4.11

5 months ago

0.4.9

6 months ago

0.4.8

7 months ago

0.4.7

7 months ago

0.4.6

7 months ago

0.4.5

7 months ago

0.4.4

7 months ago

0.4.3

7 months ago

0.4.2

9 months ago

0.4.1

9 months ago

0.4.0

9 months ago

0.3.12

10 months ago

0.3.11

10 months ago

0.3.10

10 months ago

0.3.9

10 months ago

0.3.8

10 months ago

0.3.7

10 months ago