Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@ import {AbstractWorkflowNode} from './abstract-workflow-node.class';
export abstract class WorkflowAction<E> extends AbstractWorkflowNode<E> {
abstract isElseAction: boolean;
type = NodeTypes.ACTION;

private static _isEnabled = true;

isEnabled(): boolean {
return (this.constructor as typeof WorkflowAction)._isEnabled;
}

static setEnabled(value: boolean): void {
this._isEnabled = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ export abstract class WorkflowEvent<E> extends AbstractWorkflowNode<E> {
abstract trigger: boolean;
type = NodeTypes.EVENT;
startElement: string;
private static _isEnabled = true;

isEnabled(): boolean {
return (this.constructor as typeof WorkflowEvent)._isEnabled;
}

static setEnabled(value: boolean): void {
this._isEnabled = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class BpmnNodesService<E> extends NodeService<E> {
const actions = this.nodes
.map(Node => new Node(localizedStrings, this.utils.uuid()))
.filter(n => n.type === NodeTypes.ACTION)
.filter(action => (action as WorkflowAction<E>).isEnabled())
.sort((a, b) =>
a.name.toString().localeCompare(b.name.toString(), undefined, {
sensitivity: 'base',
Expand Down Expand Up @@ -83,7 +84,8 @@ export class BpmnNodesService<E> extends NodeService<E> {
),
)
.filter(n => n.type === NodeTypes.EVENT)
.filter(instance => trigger === (instance as WorkflowEvent<E>).trigger);
.filter(instance => trigger === (instance as WorkflowEvent<E>).trigger)
.filter(instance => (instance as WorkflowEvent<E>).isEnabled());
}

/**
Expand Down
Loading