chartmind 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/src/engine/actions/base-process-action.d.ts +5 -0
- package/build/src/engine/actions/base-process-action.js +20 -0
- package/build/src/engine/actions/base-process-action.js.map +1 -0
- package/build/src/engine/actions/predefined-process-action.d.ts +2 -2
- package/build/src/engine/actions/predefined-process-action.js +3 -2
- package/build/src/engine/actions/predefined-process-action.js.map +1 -1
- package/build/src/engine/actions/process-action.d.ts +2 -3
- package/build/src/engine/actions/process-action.js +2 -15
- package/build/src/engine/actions/process-action.js.map +1 -1
- package/build/src/interfaces/symbol-predefined-process.interface.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ type | Start, End, Connection, Decision, Process, Predefined process | start
|
|
|
137
137
|
condition | Connection | e.g. counter % 2 === 0 or text === 'foo' | Controls the flow from a `decision` symbol. All outgoing connections must have a condition, except the one marked as default.
|
|
138
138
|
default | Connection | 1 | Controls the flow from a `decision` symbol. Marks a connection as the default path. If all other conditions evaluate to false, this path is taken. Just one outgoing connection must be marked as the default.
|
|
139
139
|
executable | Process | e.g. increment-counter | Key for the class registered in the registry.
|
|
140
|
-
data | Process | any data in JSON format | Is added to the context before the class is executed. These values are not removed after execution but remain in the context until the chart is completed.
|
|
140
|
+
data | Process, Predefined process | any data in JSON format | Is added to the context before the class or chart is executed. These values are not removed after execution but remain in the context until the chart is completed.
|
|
141
141
|
|
|
142
142
|
All of these properties are pre-configured in the provided symbol library.
|
|
143
143
|
Only the `type` field is already filled — the rest must be completed manually for each symbol.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseAction } from './base-action';
|
|
2
|
+
import { ChartContext } from '../chart/context/chart-context';
|
|
3
|
+
export declare abstract class BaseProcessAction extends BaseAction {
|
|
4
|
+
protected addDataToContext(data: string | undefined, chartContext: ChartContext): void;
|
|
5
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseProcessAction = void 0;
|
|
4
|
+
const he_1 = require("he");
|
|
5
|
+
const base_action_1 = require("./base-action");
|
|
6
|
+
class BaseProcessAction extends base_action_1.BaseAction {
|
|
7
|
+
addDataToContext(data, chartContext) {
|
|
8
|
+
if (!data) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const unescapedData = (0, he_1.decode)(data);
|
|
12
|
+
const parsedData = JSON.parse(unescapedData);
|
|
13
|
+
const keys = Object.keys(parsedData);
|
|
14
|
+
for (const key of keys) {
|
|
15
|
+
chartContext.setVariable(key, parsedData[key]);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.BaseProcessAction = BaseProcessAction;
|
|
20
|
+
//# sourceMappingURL=base-process-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-process-action.js","sourceRoot":"","sources":["../../../../src/engine/actions/base-process-action.ts"],"names":[],"mappings":";;;AAAA,2BAA0B;AAC1B,+CAAyC;AAGzC,MAAsB,iBAAkB,SAAQ,wBAAU;IAC9C,gBAAgB,CACxB,IAAwB,EACxB,YAA0B;QAE1B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QAED,MAAM,aAAa,GAAG,IAAA,WAAM,EAAC,IAAI,CAAC,CAAC;QACnC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAErC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF;AAjBD,8CAiBC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SymbolChart } from '../../types/symbol-chart.type';
|
|
2
2
|
import { ChartContext } from '../chart/context/chart-context';
|
|
3
|
-
import {
|
|
4
|
-
export declare class PredefinedProcessAction extends
|
|
3
|
+
import { BaseProcessAction } from './base-process-action';
|
|
4
|
+
export declare class PredefinedProcessAction extends BaseProcessAction {
|
|
5
5
|
execute(chartContext: ChartContext): Promise<void>;
|
|
6
6
|
getNext(): SymbolChart | undefined;
|
|
7
7
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PredefinedProcessAction = void 0;
|
|
4
|
-
const
|
|
5
|
-
class PredefinedProcessAction extends
|
|
4
|
+
const base_process_action_1 = require("./base-process-action");
|
|
5
|
+
class PredefinedProcessAction extends base_process_action_1.BaseProcessAction {
|
|
6
6
|
async execute(chartContext) {
|
|
7
7
|
const predefinedProcess = this.symbol;
|
|
8
|
+
this.addDataToContext(predefinedProcess.data, chartContext);
|
|
8
9
|
const linkedChart = predefinedProcess.link;
|
|
9
10
|
const parts = linkedChart.split(',');
|
|
10
11
|
if (parts.length === 2) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predefined-process-action.js","sourceRoot":"","sources":["../../../../src/engine/actions/predefined-process-action.ts"],"names":[],"mappings":";;;AAGA,+
|
|
1
|
+
{"version":3,"file":"predefined-process-action.js","sourceRoot":"","sources":["../../../../src/engine/actions/predefined-process-action.ts"],"names":[],"mappings":";;;AAGA,+DAAwD;AAExD,MAAa,uBAAwB,SAAQ,uCAAiB;IACrD,KAAK,CAAC,OAAO,CAAC,YAA0B;QAC7C,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAiC,CAAC;QAEjE,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAE5D,MAAM,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC;QAC3C,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAErC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,CAAC,YAAY,CAAC,sBAAsB,CAC5C,KAAK,CAAC,CAAC,CAAC,EACR,YAAY,CAAC,OAAO,CACrB,CAAC;QACJ,CAAC;QAED,yEAAyE;IAC3E,CAAC;IAEM,OAAO;QACZ,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAEtE,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC7C,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;CACF;AA5BD,0DA4BC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ChartContext } from '../chart/context/chart-context';
|
|
2
|
-
import { BaseAction } from './base-action';
|
|
3
2
|
import { SymbolChart } from '../../types/symbol-chart.type';
|
|
4
|
-
|
|
3
|
+
import { BaseProcessAction } from './base-process-action';
|
|
4
|
+
export declare class ProcessAction extends BaseProcessAction {
|
|
5
5
|
execute(chartContext: ChartContext): Promise<void>;
|
|
6
|
-
private addDataToContext;
|
|
7
6
|
getNext(): SymbolChart | undefined;
|
|
8
7
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProcessAction = void 0;
|
|
4
|
-
const base_action_1 = require("./base-action");
|
|
5
4
|
const executable_registry_1 = require("../registry/executable-registry");
|
|
6
|
-
const
|
|
7
|
-
class ProcessAction extends
|
|
5
|
+
const base_process_action_1 = require("./base-process-action");
|
|
6
|
+
class ProcessAction extends base_process_action_1.BaseProcessAction {
|
|
8
7
|
async execute(chartContext) {
|
|
9
8
|
const processSymbol = this.symbol;
|
|
10
9
|
this.addDataToContext(processSymbol.data, chartContext);
|
|
@@ -18,18 +17,6 @@ class ProcessAction extends base_action_1.BaseAction {
|
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
// console.log(`SymbolProcess ${this.symbol.label} executed.`);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
addDataToContext(data, chartContext) {
|
|
24
|
-
if (!data) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const unescapedData = (0, he_1.decode)(data);
|
|
28
|
-
const parsedData = JSON.parse(unescapedData);
|
|
29
|
-
const keys = Object.keys(parsedData);
|
|
30
|
-
for (const key of keys) {
|
|
31
|
-
chartContext.setVariable(key, parsedData[key]);
|
|
32
|
-
}
|
|
33
20
|
}
|
|
34
21
|
getNext() {
|
|
35
22
|
const connection = this.chart.getConnectionBySourceId(this.symbol.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-action.js","sourceRoot":"","sources":["../../../../src/engine/actions/process-action.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"process-action.js","sourceRoot":"","sources":["../../../../src/engine/actions/process-action.ts"],"names":[],"mappings":";;;AAEA,yEAAmE;AAEnE,+DAAwD;AAExD,MAAa,aAAc,SAAQ,uCAAiB;IAC3C,KAAK,CAAC,OAAO,CAAC,YAA0B;QAC7C,MAAM,aAAa,GAAG,IAAI,CAAC,MAAuB,CAAC;QAEnD,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAExD,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,CAAC;QAChD,MAAM,UAAU,GACd,wCAAkB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAElE,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;YAElC,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAC9C,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;gBAC9B,MAAM,MAAM,CAAC;YACf,CAAC;QACH,CAAC;QAED,+DAA+D;IACjE,CAAC;IAEM,OAAO;QACZ,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAEtE,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC7C,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;CACF;AA/BD,sCA+BC"}
|