@node-ts/bus-workflow
Version:
A workflow engine for orchestrating logic flows in distributed applications.
32 lines (26 loc) • 957 B
text/typescript
// tslint:disable:max-classes-per-file
import { Workflow, WorkflowData } from '../workflow'
import { injectable, inject } from 'inversify'
import { TestCommand } from './test-command'
import { StartedBy } from '../workflow/decorators'
export class TestWorkflowMisconfiguredData extends WorkflowData {
$name = 'node-ts/bus/workflow/test-workflow-misconfigured'
property1: string
}
/**
* A test case where the workflow has dependencies that aren't registered with the IoC container
*/
()
export class TestWorkflowMisconfigured extends Workflow<TestWorkflowMisconfiguredData> {
constructor (
(Symbol.for('TestWorkflowMisconfiguredFakeDependency')) readonly _: string
) {
super()
}
<TestCommand, TestWorkflowMisconfiguredData, 'handleTestCommand'>(TestCommand)
handleTestCommand (command: TestCommand): Partial<TestWorkflowMisconfiguredData> {
return {
property1: command.property1
}
}
}