Releases: nocode-js/sequential-workflow-machine
Releases · nocode-js/sequential-workflow-machine
0.7.1
0.7.0
0.6.0
This version introduces the parallel activity. The parallel activity allows to execute in the same time many activities.
Breaking Changes
- The
getStatePath
method in theWorkflowMachineSnapshot
class is deleted. Please use thetryGetStatePath
method or thegetStatePaths
method instead.
0.5.2
0.5.1
This version adds a new feature to the fork
activity. Now it's possible to skip all branches. The handler of the fork
activity should return a value returned by the skip()
function.
createForkActivity<BranchedStep, TestGlobalState>('if', {
init: () => ({ /* ... */ }),
handler: async (step, globalState, activityState) => {
// ...
return skip();
}
})
0.5.0
This version simplifies error handling:
- The
getSnapshot()
method now returns an instance of theWorkflowMachineSnapshot
class, which includes three new methods:isFinished()
,isFailed()
, andisInterrupted()
. Additionally, you can retrieve the id of the last executing step by calling thetryGetCurrentStepId()
method. - The
unhandledError
property of the snapshot class is always an instance of theMachineUnhandledError
class.
0.4.0
0.3.2
0.3.1
0.3.0
This version changes the syntax of all create*Activity
functions. The first argument is the step type, the second argument is the configuration.
// Old syntax
const fooActivity = createAtomActivity<FooStep, MyGlobalState, FooStateState>({
stepType: 'foo',
init: /* ... */,
handler: /* ... */,
})
// New syntax
const fooActivity = createAtomActivity<FooStep, MyGlobalState, FooStateState>('foo', {
init: /* ... */,
handler: /* ... */,
})
Additionally this version introduces the createAtomActivityFromHandler
function. It allows to create an activity by very short syntax. This function creates an activity without the activity state.
const fooActivity = createAtomActivityFromHandler<FooStep, MyGlobalState>('foo', async (step, globalState) => {
// handler
});