Skip to content

Commit 2b7d1c0

Browse files
Akanksha	 SinghAkanksha	 Singh
authored andcommitted
feat(core): fix all event change req
1 parent 95c794e commit 2b7d1c0

11 files changed

Lines changed: 21 additions & 32 deletions

File tree

projects/workflows-creator/src/lib/classes/nodes/abstract-workflow-action.class.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,14 @@ import {AbstractWorkflowNode} from './abstract-workflow-node.class';
44
export abstract class WorkflowAction<E> extends AbstractWorkflowNode<E> {
55
abstract isElseAction: boolean;
66
type = NodeTypes.ACTION;
7+
8+
private static _isEnabled: boolean = true;
9+
10+
isEnabled(): boolean {
11+
return (this.constructor as typeof WorkflowAction)._isEnabled;
12+
}
13+
14+
static setEnabled(value: boolean): void {
15+
this._isEnabled = value;
16+
}
717
}

projects/workflows-creator/src/lib/classes/nodes/abstract-workflow-event.class.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,13 @@ export abstract class WorkflowEvent<E> extends AbstractWorkflowNode<E> {
55
abstract trigger: boolean;
66
type = NodeTypes.EVENT;
77
startElement: string;
8+
static _isEnabled: boolean = true;
9+
10+
isEnabled(): boolean {
11+
return (this.constructor as typeof WorkflowEvent)._isEnabled;
12+
}
13+
14+
static setEnabled(value: boolean): void {
15+
this._isEnabled = value;
16+
}
817
}

projects/workflows-creator/src/lib/classes/nodes/abstract-workflow-node.class.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ export abstract class AbstractWorkflowNode<E> {
1212
abstract state: State<RecordOfAnyType>;
1313
abstract name: string;
1414
static identifier: string;
15-
static isEnabled: boolean;
1615
id: string;
1716

1817
abstract getIdentifier(): string;
19-
abstract checkIsEnabled(): boolean;
2018
}

projects/workflows-creator/src/lib/services/bpmn/node.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class BpmnNodesService<E> extends NodeService<E> {
4343
const actions = this.nodes
4444
.map(Node => new Node(localizedStrings, this.utils.uuid()))
4545
.filter(n => n.type === NodeTypes.ACTION)
46-
.filter(action => (action as WorkflowAction<E>).checkIsEnabled())
46+
.filter(action => (action as WorkflowAction<E>).isEnabled())
4747
.sort((a, b) =>
4848
a.name.toString().localeCompare(b.name.toString(), undefined, {
4949
sensitivity: 'base',
@@ -85,7 +85,7 @@ export class BpmnNodesService<E> extends NodeService<E> {
8585
)
8686
.filter(n => n.type === NodeTypes.EVENT)
8787
.filter(instance => trigger === (instance as WorkflowEvent<E>).trigger)
88-
.filter(instance => (instance as WorkflowEvent<E>).checkIsEnabled());
88+
.filter(instance => (instance as WorkflowEvent<E>).isEnabled);
8989
}
9090

9191
/**

projects/workflows-creator/src/lib/services/statement/actions/changecolumn.action.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {LocalizedStringKeys} from '../../../enum';
66
import {RecordOfAnyType} from '../../../types';
77

88
export class ChangeColumnValueAction extends BpmnAction {
9-
static isEnabled = true;
109
isElseAction: boolean;
1110
groupType: string;
1211
groupId: string;
@@ -35,7 +34,4 @@ export class ChangeColumnValueAction extends BpmnAction {
3534
getIdentifier(): string {
3635
return ChangeColumnValueAction.identifier;
3736
}
38-
checkIsEnabled(): boolean {
39-
return ChangeColumnValueAction.isEnabled;
40-
}
4137
}

projects/workflows-creator/src/lib/services/statement/actions/readcolumn.action.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {RecordOfAnyType} from '../../../types';
22
import {BpmnAction} from '../../../types/bpmn.types';
33

44
export class ReadColumnValueAction extends BpmnAction {
5-
static isEnabled = true;
65
isElseAction: boolean;
76
groupType: string;
87
groupId: string;
@@ -28,7 +27,4 @@ export class ReadColumnValueAction extends BpmnAction {
2827
getIdentifier(): string {
2928
return ReadColumnValueAction.identifier;
3029
}
31-
checkIsEnabled(): boolean {
32-
return ReadColumnValueAction.isEnabled;
33-
}
3430
}

projects/workflows-creator/src/lib/services/statement/actions/sendmail.action.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
} from '../inputs/email.input';
1010

1111
export class SendEmailAction extends BpmnAction {
12-
static isEnabled = true;
1312
isElseAction: boolean;
1413
groupType: string;
1514
groupId: string;
@@ -41,7 +40,4 @@ export class SendEmailAction extends BpmnAction {
4140
getIdentifier(): string {
4241
return SendEmailAction.identifier;
4342
}
44-
checkIsEnabled(): boolean {
45-
return SendEmailAction.isEnabled;
46-
}
4743
}

projects/workflows-creator/src/lib/services/statement/events/onadditem.event.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {BpmnEvent} from '../../../types/bpmn.types';
44
import {TriggerOnAddItem} from '../../bpmn/elements/tasks/trigger-on-add-item.task';
55

66
export class OnAddItemEvent extends BpmnEvent {
7-
static isEnabled = true;
87
groupType: string;
98
groupId: string;
109
trigger = true;
@@ -35,7 +34,4 @@ export class OnAddItemEvent extends BpmnEvent {
3534
getIdentifier(): string {
3635
return OnAddItemEvent.identifier;
3736
}
38-
checkIsEnabled(): boolean {
39-
return OnAddItemEvent.isEnabled;
40-
}
4137
}

projects/workflows-creator/src/lib/services/statement/events/onchange.event.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {TriggerColumnInput, ValueTypeInput} from '../inputs';
88
import {ValueInput} from '../inputs/value.input';
99

1010
export class OnChangeEvent extends BpmnEvent {
11-
static isEnabled = true;
1211
groupType: string;
1312
groupId: string;
1413
trigger = true;
@@ -44,7 +43,4 @@ export class OnChangeEvent extends BpmnEvent {
4443
getIdentifier(): string {
4544
return OnChangeEvent.identifier;
4645
}
47-
checkIsEnabled(): boolean {
48-
return OnChangeEvent.isEnabled;
49-
}
5046
}

projects/workflows-creator/src/lib/services/statement/events/oninterval.event.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {IntervalInput} from '../inputs/interval.input';
77
import {StepperInput} from '../inputs/stepper.input';
88

99
export class OnIntervalEvent extends BpmnEvent {
10-
static isEnabled = true;
1110
groupType: string;
1211
groupId: string;
1312
trigger = true;
@@ -40,7 +39,4 @@ export class OnIntervalEvent extends BpmnEvent {
4039
getIdentifier(): string {
4140
return OnIntervalEvent.identifier;
4241
}
43-
checkIsEnabled(): boolean {
44-
return OnIntervalEvent.isEnabled;
45-
}
4642
}

0 commit comments

Comments
 (0)