Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let fs = require("fs");
let { startForm, eventForm, restartForm } = require("./forms").default;
let {MachineDefinition, Machine} = require("@opuscapita/fsm-workflow-core");
let machineSchemaAsText = fs.readFileSync("./machine-schema.json", "utf8");
let machineDefinition = new MachineDefinition({
schema: JSON.parse(machineSchemaAsText),
objectConfiguration: {
stateFieldName: "status"
},
});
let invoiceMachine = new Machine({
machineDefinition,
convertObjectToReference: (o) => {
return {
//...we don't need it here
}
}
});
let invoice = {
status: "none"
};
let blessed = require("blessed");
let program = blessed.program();
// Create a screen object.
constructor(props) {
super(props);
this.state = {
machine: new MachineDefinition(props.workflow),
selectedStates: [],
selectedTransitions: [],
activeTabKey: 0
};
}
describe('Task manager:event sending', function() {
const machine = new Machine({
machineDefinition: new MachineDefinition({
objectConfiguration: {
"stateFieldName": "status"
},
schema: {
"name": "test",
"initialState": "init",
"finalStates": [
"finished"
],
"transitions": [
{
"from": "init",
"event": "finish",
"to": "finished",
}
]
constructor(props) {
super(props);
this.processMachine = new Machine({
machineDefinition: new MachineDefinition({
schema: require('../workflow/process-schema.json'),
objectConfiguration: require('../workflow/objectConfiguration.json'),
actions: require('../workflow/actions').default,
conditions: require('../workflow/conditions').default
}),
context: {
sendNotification: ({ notification }) => {
this._notificationSystem.addNotification(notification);
}
},
convertObjectToReference: (o) => {
return {
//...we don't need it here
}
}
});
get machine() {
return new Machine({
machineDefinition: new MachineDefinition({
schema: schema.getSchema(),
actions,
conditions,
objectConfiguration: objectConfig.getConfig()
}),
convertObjectToReference: object => ({
businessObjType: 'invoice',
businessObjId: object[objectIdProp]
}),
history: this.history
})
}
}
componentWillReceiveProps(nextProps) {
if (!isEqual(nextProps.workflow, this.props.workflow)) {
this.setState({
machine: new MachineDefinition(nextProps.workflow)
});
}
}
let fs = require("fs");
let { startForm, eventForm, restartForm } = require("./forms").default;
let {MachineDefinition, Machine} = require("@opuscapita/fsm-workflow-core");
let machineSchemaAsText = fs.readFileSync("./machine-schema.json", "utf8");
let machineDefinition = new MachineDefinition({
schema: JSON.parse(machineSchemaAsText),
objectConfiguration: {
stateFieldName: "status"
},
});
let invoiceMachine = new Machine({
machineDefinition,
convertObjectToReference: (o) => {
return {
//...we don't need it here
}
}
});
let invoice = {
describe('Task manager:event sending', function() {
const machine = new Machine({
machineDefinition: new MachineDefinition({
schema: {
"name": "test",
"initialState": "init",
"finalStates": [
"finished"
],
"objectStateFieldName": "status",
"transitions": [
{
"from": "init",
"event": "finish",
"to": "finished",
}
]
}
})
describe('Task manager:monitoring', function() {
const machine = new Machine({
machineDefinition: new MachineDefinition({
objectConfiguration: {
"stateFieldName": "status"
},
schema: {
"name": "test",
"initialState": "init",
"finalStates": [
"finished"
],
"transitions": [
{
"from": "init",
"event": "autoFinish",
"to": "finished",
"automatic": true
}
describe('Task manager:event sending', function() {
const machine = new Machine({
machineDefinition: new MachineDefinition({
objectConfiguration: {
"stateFieldName": "status"
},
schema: {
"name": "test",
"initialState": "init",
"finalStates": [
"finished"
],
"transitions": [
{
"from": "init",
"event": "finish",
"to": "finished",
}