
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@opuscapita/fsm-workflow-history
Advanced tools
Workflow History is an extension to FSM Core. It provides server-side API for storing and extracting Business Object lifecycle history.
Install package
npm install --save-prod @opuscapita/fsm-workflow-history
// Run migrations and initiate an instance of FSM Workflow History.
const history = await require('@opuscapita/fsm-workflow-history')(sequelize);
history is JavaScript object with the following structure/interface:
{
// add history record
async add({
from: <string>,
to: <string>,
event: <string>,
businessObjType: <string>,
businessObjId: <string>,
user: <string>,
workflowName: <string>,
?description: <string>
}) {
...
return <History Record>;
},
// search for history record
async search({
?object: {
?businessObjType: <string>, // example: 'invoice'
?businessObjId: <string> // example: 'john.miller'
},
?user: <string>,
?workflowName: <string>,
?finishedOn: {
?gt: <date>, // example: new Date("2018-03-05T21:00:00.000Z")
?gte: <date>,
?lt: <date>,
?lte: <date>
}
}, {
?max: <number, 100 by default>,
?offset: <number, 0 by default>
}, {
?by: <string, History Record field name, "finishedOn" by default>, // example: 'user'
?order: <string, "desc" (default) or "asc">
}) {
...
return [<History Record>, ... ];
}
// delete history record
async delete({
businessObjType: <string>,
businessObjId: <string>,
}) {
...
return <deleted records number>;
},
}
History Record is JavaScript object with values from DB:
Column | Type | Required | Notes |
---|---|---|---|
id | integer | true | autogenerated id |
from | string | true | |
to | string | true | |
event | string | true | |
businessObjType | string | true | example: 'invoice' |
businessObjId | string | true | example: '123456789' |
user | string | true | user initiated a transition |
workflowName | string | true | unique workflow name, known by workflow machine |
description | string | false | event/object/trsnaition information |
finishedOn | timestamp | true | like in Grailsflow, object finished the transition in 'to' state |
See Express Server Demo for an example of using Workflow History.
FAQs
Business-object history for FSM workflow
We found that @opuscapita/fsm-workflow-history demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 29 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.