@notmrabhi/flowforge 0.1.116 → 0.1.117
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/dist/buildBackendPayload-4knoDOFf.js +2 -0
- package/dist/{buildBackendPayload-ty2Yn_kg.js.map → buildBackendPayload-4knoDOFf.js.map} +1 -1
- package/dist/buildBackendPayload-DKoSTSTU.js +382 -0
- package/dist/{buildBackendPayload-C9xBGiLv.js.map → buildBackendPayload-DKoSTSTU.js.map} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/buildBackendPayload-C9xBGiLv.js +0 -381
- package/dist/buildBackendPayload-ty2Yn_kg.js +0 -2
package/dist/core.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nodeRegistry.cjs"),r=require("./templateRegistry.cjs"),t=require("./messages-Bg7b9RbI.js"),o=require("./bpmn-CcuE2X_Q.js"),i=require("./buildBackendPayload-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nodeRegistry.cjs"),r=require("./templateRegistry.cjs"),t=require("./messages-Bg7b9RbI.js"),o=require("./bpmn-CcuE2X_Q.js"),i=require("./buildBackendPayload-4knoDOFf.js");exports.NodeTypeRegistry=e.NodeTypeRegistry;exports.baseNodeDefaults=e.baseNodeDefaults;exports.conditionBranchDescriptor=e.conditionBranchDescriptor;exports.defineNode=e.defineNode;exports.endEventDescriptor=e.endEventDescriptor;exports.makeSubWorkflowDescriptor=e.makeSubWorkflowDescriptor;exports.nodeTypeRegistry=e.nodeTypeRegistry;exports.notificationDescriptor=e.notificationDescriptor;exports.restApiDescriptor=e.restApiDescriptor;exports.startEventDescriptor=e.startEventDescriptor;exports.subWorkflowDescriptor=e.subWorkflowDescriptor;exports.webhookTriggerDescriptor=e.webhookTriggerDescriptor;exports.webhookTriggerTemplate=e.webhookTriggerTemplate;exports.TemplateRegistry=r.TemplateRegistry;exports.templateRegistry=r.templateRegistry;exports.defaultFlowForgeMessages=t.defaultFlowForgeMessages;exports.loadWorkflowFromBpmn=o.loadWorkflowFromBpmn;exports.saveWorkflowToBpmn=o.saveWorkflowToBpmn;exports.buildBackendPayload=i.buildBackendPayload;
|
|
2
2
|
//# sourceMappingURL=core.cjs.map
|
package/dist/core.js
CHANGED
|
@@ -2,7 +2,7 @@ import { NodeTypeRegistry as r, baseNodeDefaults as t, conditionBranchDescriptor
|
|
|
2
2
|
import { TemplateRegistry as k, templateRegistry as b } from "./templateRegistry.js";
|
|
3
3
|
import { d as y } from "./messages-CRZgWFU-.js";
|
|
4
4
|
import { l as u, s as x } from "./bpmn-CtfWDaOY.js";
|
|
5
|
-
import { b as R } from "./buildBackendPayload-
|
|
5
|
+
import { b as R } from "./buildBackendPayload-DKoSTSTU.js";
|
|
6
6
|
export {
|
|
7
7
|
r as NodeTypeRegistry,
|
|
8
8
|
k as TemplateRegistry,
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BhhUO6Ue.js"),T=require("./SchemaBuilderDrawer-CtGanHvg.js");require("react/jsx-runtime");require("react");require("@mui/material");require("react-icons/md");const i=require("./nodeRegistry.cjs"),F=require("./templateRegistry.cjs"),p=require("./WorkflowExecutionHistory-BhB2RdfX.js"),S=require("./messages-Bg7b9RbI.js"),h=require("./bpmn-CcuE2X_Q.js"),t=require("./GatewayBranchEdge-CQBOd1Bp.js"),R=require("./buildBackendPayload-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BhhUO6Ue.js"),T=require("./SchemaBuilderDrawer-CtGanHvg.js");require("react/jsx-runtime");require("react");require("@mui/material");require("react-icons/md");const i=require("./nodeRegistry.cjs"),F=require("./templateRegistry.cjs"),p=require("./WorkflowExecutionHistory-BhB2RdfX.js"),S=require("./messages-Bg7b9RbI.js"),h=require("./bpmn-CcuE2X_Q.js"),t=require("./GatewayBranchEdge-CQBOd1Bp.js"),R=require("./buildBackendPayload-4knoDOFf.js");class N{constructor(){this.channels=new Map}register(r,s){this.channels.set(r,s)}get(r){return this.channels.get(r)}list(){return Array.from(this.channels.entries()).map(([r,s])=>({key:r,...s}))}has(r){return this.channels.has(r)}}const v=new N;function D(o){const{currentNodeId:r,nodes:s,getParents:l,getOutputSchema:a,nodePath:d,nodeLabel:u,getNodeId:c=n=>n.id}=o,g=s.find(n=>c(n)===r);if(!g)return[];const w=P(g,s,l,c),f=[];for(const n of w){const y=a(n);if(!y||y.length===0)continue;const b=d(n);f.push({label:u?u(n):b,items:y.map(k=>m(k,b))})}return f}function P(o,r,s,l){const a=new Set,d=[],u=[...s(o,r)];for(;u.length>0;){const c=u.shift(),g=l(c);a.has(g)||(a.add(g),d.push(c),u.push(...s(c,r)))}return d}function m(o,r){const s=`${r}.${o.key}`,l=o.description??(o.sample!==void 0&&o.sample!==null?String(o.sample):void 0),a={label:o.label,path:s,key:o.key};return l!==void 0&&(a.description=l),(o.isList||o.type==="array")&&(a.isList=!0),o.children&&o.children.length>0&&(a.children=o.children.map(d=>m(d,s))),a}exports.DRAG_DATA_KEY=e.DRAG_DATA_KEY;exports.DynamicFormRenderer=e.DynamicFormRenderer;exports.FF=e.FF;exports.FlowForgeRegistry=e.FlowForgeRegistry;exports.FlowForm=e.FlowForm;exports.FormulaInput=e.FormulaInput;exports.InfiniteSelectField=e.InfiniteSelectField;exports.OptionsResolversProvider=e.OptionsResolversProvider;exports.TablePickerField=e.TablePickerField;exports.VariablePicker=e.VariablePicker;exports.VariablePickerProvider=e.VariablePickerProvider;exports.astHasRefs=e.astHasRefs;exports.astToTokens=e.astToTokens;exports.buildEvaluationPayload=e.buildEvaluationPayload;exports.buildFieldConfig=e.buildFieldConfig;exports.buildFormulaPath=e.buildFormulaPath;exports.buildSelectStyles=e.buildSelectStyles;exports.buildValidationSchema=e.buildValidationSchema;exports.conditionConfigToRulePayload=e.conditionConfigToRulePayload;exports.conditionNodesToRuleTree=e.conditionNodesToRuleTree;exports.dataSourceRegistry=e.dataSourceRegistry;exports.errorTextStyle=e.errorTextStyle;exports.extractLabel=e.extractLabel;exports.fieldRegistry=e.fieldRegistry;exports.hasFormulaTokens=e.hasFormulaTokens;exports.helperTextStyle=e.helperTextStyle;exports.inputStyle=e.inputStyle;exports.isFormula=e.isFormula;exports.leafReference=e.leafReference;exports.parseToAST=e.parseToAST;exports.ruleConditionsToNodes=e.ruleConditionsToNodes;exports.rulePayloadToConditionConfig=e.rulePayloadToConditionConfig;exports.serializeAST=e.serializeAST;exports.serializeASTAsConfig=e.serializeASTAsConfig;exports.serializeConditionExpressions=e.serializeConditionExpressions;exports.stripFormulaTokens=e.stripFormulaTokens;exports.tokenize=e.tokenize;exports.unwrapFormula=e.unwrapFormula;exports.useDynamicOptions=e.useDynamicOptions;exports.useOptionsResolvers=e.useOptionsResolvers;exports.useVariablePickerContext=e.useVariablePickerContext;exports.variableSubtreeToValue=e.variableSubtreeToValue;exports.wrapFormula=e.wrapFormula;exports.FIELD_TYPE_OPTIONS=T.FIELD_TYPE_OPTIONS;exports.SchemaBuilder=T.SchemaBuilder;exports.SchemaBuilderDrawer=T.SchemaBuilderDrawer;exports.useFlowForm=T.useFlowForm;exports.NodeTypeRegistry=i.NodeTypeRegistry;exports.baseNodeDefaults=i.baseNodeDefaults;exports.conditionBranchDescriptor=i.conditionBranchDescriptor;exports.defineNode=i.defineNode;exports.endEventDescriptor=i.endEventDescriptor;exports.makeSubWorkflowDescriptor=i.makeSubWorkflowDescriptor;exports.nodeTypeRegistry=i.nodeTypeRegistry;exports.notificationDescriptor=i.notificationDescriptor;exports.restApiDescriptor=i.restApiDescriptor;exports.startEventDescriptor=i.startEventDescriptor;exports.subWorkflowDescriptor=i.subWorkflowDescriptor;exports.webhookTriggerDescriptor=i.webhookTriggerDescriptor;exports.webhookTriggerTemplate=i.webhookTriggerTemplate;exports.TemplateRegistry=F.TemplateRegistry;exports.templateRegistry=F.templateRegistry;exports.FlowForgeCanvas=p.FlowForgeCanvas;exports.FlowForgeHeader=p.FlowForgeHeader;exports.SubWorkflowPreviewDrawer=p.SubWorkflowPreviewDrawer;exports.WorkflowCanvas=p.FlowForgeCanvas;exports.WorkflowExecutionHistory=p.WorkflowExecutionHistory;exports.WorkflowTemplateLibrary=p.WorkflowTemplateLibrary;exports.defaultFlowForgeMessages=S.defaultFlowForgeMessages;exports.loadWorkflowFromBpmn=h.loadWorkflowFromBpmn;exports.saveWorkflowToBpmn=h.saveWorkflowToBpmn;exports.ActionNode=t.ActionNode;exports.ApprovalNode=t.ApprovalNode;exports.EdgeWithPlusLabel=t.EdgeWithPlusLabel;exports.EndNode=t.EndNode;exports.FilterNode=t.FilterNode;exports.NodeBody=t.NodeBody;exports.RestApiNode=t.RestApiNode;exports.StartNode=t.StartNode;exports.TriggerNode=t.TriggerNode;exports.WebhookTriggerNode=t.WebhookTriggerNode;exports.builtInNodeTypes=t.builtInNodeTypes;exports.deriveRows=t.deriveRows;exports.resolveNodeRows=t.resolveNodeRows;exports.buildBackendPayload=R.buildBackendPayload;exports.buildVariableGroups=D;exports.notificationChannelRegistry=v;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { F as Oe, a as ze, S as He, F as _e, W as Ge, b as Me } from "./Workflow
|
|
|
10
10
|
import { d as Ke } from "./messages-CRZgWFU-.js";
|
|
11
11
|
import { l as $e, s as je } from "./bpmn-CtfWDaOY.js";
|
|
12
12
|
import { A as Ue, b as Qe, E as Xe, c as Ze, F as es, f as ss, R as os, S as as, T as rs, W as ts, e as is, g as ns, r as ls } from "./GatewayBranchEdge-Ceuxbttn.js";
|
|
13
|
-
import { b as cs } from "./buildBackendPayload-
|
|
13
|
+
import { b as cs } from "./buildBackendPayload-DKoSTSTU.js";
|
|
14
14
|
class g {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.channels = /* @__PURE__ */ new Map();
|
package/package.json
CHANGED
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
const S = {
|
|
2
|
-
triggerToCategory: {},
|
|
3
|
-
schedulerEventTypes: [],
|
|
4
|
-
conditionPathPrefix: "",
|
|
5
|
-
defaultWorkflowCategory: "",
|
|
6
|
-
endEventIds: {
|
|
7
|
-
success: "endEventSuccess",
|
|
8
|
-
failure: "endEventFailure",
|
|
9
|
-
rejected: "endEventRejected"
|
|
10
|
-
},
|
|
11
|
-
endEventNames: {
|
|
12
|
-
success: "Success",
|
|
13
|
-
failure: "Failure",
|
|
14
|
-
rejected: "Rejected"
|
|
15
|
-
},
|
|
16
|
-
startEventId: "startEvent",
|
|
17
|
-
triggerConfigDefaults: {}
|
|
18
|
-
};
|
|
19
|
-
function H(e) {
|
|
20
|
-
if (!e || typeof e != "object") return {};
|
|
21
|
-
const t = {};
|
|
22
|
-
return Object.keys(e).forEach((i) => {
|
|
23
|
-
i.startsWith("_") || (t[i] = e[i]);
|
|
24
|
-
}), t;
|
|
25
|
-
}
|
|
26
|
-
const X = /* @__PURE__ */ new Set([
|
|
27
|
-
"start",
|
|
28
|
-
"end",
|
|
29
|
-
"triggerFixed",
|
|
30
|
-
"addTrigger",
|
|
31
|
-
"addStep"
|
|
32
|
-
]), q = (e) => !!e && !X.has(String(e.kind ?? ""));
|
|
33
|
-
function D(e, t) {
|
|
34
|
-
return e == null ? "" : String(e).replace(
|
|
35
|
-
/\$\{(\w+)\}/g,
|
|
36
|
-
(i, a) => Object.prototype.hasOwnProperty.call(t, a) ? String(t[a]) : i
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
function Y(e, t) {
|
|
40
|
-
var s, g, c, d, E;
|
|
41
|
-
if (!e || typeof e != "object") return "";
|
|
42
|
-
const { from: i, key: a, value: r } = e;
|
|
43
|
-
return i === "literal" ? r === void 0 ? "" : String(r) : i === "task" ? String(((s = t.task) == null ? void 0 : s[a ?? ""]) ?? "") : i === "ctx" ? String(((g = t.ctx) == null ? void 0 : g[a ?? ""]) ?? "") : i === "slot" ? String(((c = t.slot) == null ? void 0 : c[a ?? ""]) ?? "") : i === "formData" ? String(((E = (d = t.slot) == null ? void 0 : d.formData) == null ? void 0 : E[a ?? ""]) ?? "") : "";
|
|
44
|
-
}
|
|
45
|
-
function Z(e, t) {
|
|
46
|
-
var a, r, s;
|
|
47
|
-
const i = e == null ? void 0 : e.source;
|
|
48
|
-
if (!i) return "";
|
|
49
|
-
if (i.type === "literal")
|
|
50
|
-
return typeof i.value == "string" ? i.value : JSON.stringify(i.value ?? "");
|
|
51
|
-
if (i.type === "json" || i.type === "taskConfig") {
|
|
52
|
-
const g = i.shape || {}, c = {};
|
|
53
|
-
return Object.keys(g).forEach((d) => {
|
|
54
|
-
c[d] = Y(g[d], t);
|
|
55
|
-
}), JSON.stringify(c);
|
|
56
|
-
}
|
|
57
|
-
if (i.type === "formData") {
|
|
58
|
-
if (i.passthrough) {
|
|
59
|
-
const g = new Set(i.exclude || []), c = {}, d = ((a = t.slot) == null ? void 0 : a.formData) ?? {};
|
|
60
|
-
Object.keys(d).forEach((v) => {
|
|
61
|
-
v.startsWith("_") || g.has(v) || (c[v] = d[v]);
|
|
62
|
-
});
|
|
63
|
-
const E = i.wrapKey ? { [i.wrapKey]: c } : c;
|
|
64
|
-
return JSON.stringify(E);
|
|
65
|
-
}
|
|
66
|
-
return String(((s = (r = t.slot) == null ? void 0 : r.formData) == null ? void 0 : s[i.key ?? ""]) ?? "");
|
|
67
|
-
}
|
|
68
|
-
return "";
|
|
69
|
-
}
|
|
70
|
-
function ee(e, t) {
|
|
71
|
-
if (!(!e || typeof e != "object" || !t))
|
|
72
|
-
return t.split(".").reduce((i, a) => {
|
|
73
|
-
if (!(i == null || typeof i != "object"))
|
|
74
|
-
return i[a];
|
|
75
|
-
}, e);
|
|
76
|
-
}
|
|
77
|
-
function te(e, t, i) {
|
|
78
|
-
var b;
|
|
79
|
-
const a = e.operatorMap || {}, r = e.valuesField || "groups", s = (o) => {
|
|
80
|
-
const p = a[String((o == null ? void 0 : o.operator) ?? "")] ?? "==", m = `${i}.${(o == null ? void 0 : o.key) ?? (o == null ? void 0 : o.field) ?? ""}`, h = `'${String((o == null ? void 0 : o.value) ?? "")}'`;
|
|
81
|
-
return p.startsWith(".") ? `${m}${p}(${h})` : p.startsWith("!.") ? `!${m}${p.slice(1)}(${h})` : `${m} ${p} ${h}`;
|
|
82
|
-
}, g = (o) => {
|
|
83
|
-
var u, T;
|
|
84
|
-
const p = Array.isArray(o) ? o : [];
|
|
85
|
-
if (p.length === 0) return null;
|
|
86
|
-
const m = p.map(s), l = ((u = p[0]) == null ? void 0 : u.connector) === "or" || ((T = p[0]) == null ? void 0 : T.logicalOperator) === "OR" ? "||" : "&&";
|
|
87
|
-
return m.join(` ${l} `);
|
|
88
|
-
}, c = [];
|
|
89
|
-
let d = 1;
|
|
90
|
-
const E = (o, p) => {
|
|
91
|
-
c.push({
|
|
92
|
-
id: `rule${d}`,
|
|
93
|
-
inputEntries: [
|
|
94
|
-
{
|
|
95
|
-
id: `rule${d}InputEntry1`,
|
|
96
|
-
text: o ? `\${(${o})}` : ""
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
outputEntries: [
|
|
100
|
-
{
|
|
101
|
-
id: `rule${d}OutputEntry1`,
|
|
102
|
-
text: `"${p}"`
|
|
103
|
-
}
|
|
104
|
-
]
|
|
105
|
-
}), d += 1;
|
|
106
|
-
}, v = Array.isArray((b = t == null ? void 0 : t.formData) == null ? void 0 : b.groupBlocks) ? t.formData.groupBlocks : [];
|
|
107
|
-
if (v.length > 0)
|
|
108
|
-
return v.forEach((o) => {
|
|
109
|
-
const p = Array.isArray(o == null ? void 0 : o[r]) ? o[r] : [], m = g(o == null ? void 0 : o.conditions);
|
|
110
|
-
p.forEach((h) => E(m, h));
|
|
111
|
-
}), c;
|
|
112
|
-
const f = (t == null ? void 0 : t.formData) ?? {}, y = f._conditionConfig ?? f.conditionConfig, C = [];
|
|
113
|
-
if (y && typeof y == "object" && Object.keys(y).forEach((o) => {
|
|
114
|
-
const p = y[o], m = g(p);
|
|
115
|
-
m && C.push(m);
|
|
116
|
-
const h = Object.prototype.hasOwnProperty.call(f, o) ? f[o] : ee(f, o);
|
|
117
|
-
Array.isArray(h) ? h.forEach((l) => {
|
|
118
|
-
const u = typeof l == "object" && l !== null ? l.value ?? l.label ?? l : l;
|
|
119
|
-
E(m, u);
|
|
120
|
-
}) : h != null && h !== "" ? E(m, h) : m && E(m, "");
|
|
121
|
-
}), e.fallback === "negation") {
|
|
122
|
-
const o = e.fallbackField || "fallback", p = f[o], m = Array.isArray(p) ? p : p != null && p !== "" ? [p] : [];
|
|
123
|
-
if (m.length > 0) {
|
|
124
|
-
const h = C.length > 0 ? `!(${C.map((l) => `(${l})`).join(" || ")})` : null;
|
|
125
|
-
m.forEach((l) => {
|
|
126
|
-
const u = typeof l == "object" && l !== null ? l.value ?? l.label ?? l : l;
|
|
127
|
-
E(h, u);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return c;
|
|
132
|
-
}
|
|
133
|
-
function ne(e, t, i) {
|
|
134
|
-
var v;
|
|
135
|
-
const a = e.operatorMap || {}, r = e.pathPrefix ?? i, s = e.conditionsField || "conditions", g = (v = t == null ? void 0 : t.formData) == null ? void 0 : v[s], c = Array.isArray(g) ? g : [];
|
|
136
|
-
if (c.length === 0) return "";
|
|
137
|
-
const d = (f) => {
|
|
138
|
-
const y = a[String((f == null ? void 0 : f.operator) ?? "")] ?? "==", C = `${r}.${(f == null ? void 0 : f.key) ?? (f == null ? void 0 : f.field) ?? ""}`, b = `'${String((f == null ? void 0 : f.value) ?? "")}'`;
|
|
139
|
-
return y.startsWith("!.") ? `!${C}${y.slice(1)}(${b})` : y.startsWith(".") ? `${C}${y}(${b})` : `${C} ${y} ${b}`;
|
|
140
|
-
};
|
|
141
|
-
let E = d(c[0]);
|
|
142
|
-
for (let f = 1; f < c.length; f += 1) {
|
|
143
|
-
const y = c[f - 1], C = (y == null ? void 0 : y.connector) === "or" || (y == null ? void 0 : y.logicalOperator) === "OR";
|
|
144
|
-
E += ` ${C ? "||" : "&&"} ${d(c[f])}`;
|
|
145
|
-
}
|
|
146
|
-
return E;
|
|
147
|
-
}
|
|
148
|
-
function se(e, t, i) {
|
|
149
|
-
return {
|
|
150
|
-
mappings: [],
|
|
151
|
-
name: e.tableName,
|
|
152
|
-
decision: {
|
|
153
|
-
id: e.tableName,
|
|
154
|
-
name: e.tableName,
|
|
155
|
-
decisionTable: {
|
|
156
|
-
id: `decisionTable_${e.tableName}`,
|
|
157
|
-
hitPolicy: e.hitPolicy || "FIRST",
|
|
158
|
-
inputs: [
|
|
159
|
-
{
|
|
160
|
-
id: `input_${e.tableName}`,
|
|
161
|
-
inputExpression: {
|
|
162
|
-
id: `inputExpr_${e.tableName}`,
|
|
163
|
-
typeRef: "string",
|
|
164
|
-
text: e.inputExpr
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
],
|
|
168
|
-
outputs: (e.outputs || []).map((a) => ({
|
|
169
|
-
id: a.id,
|
|
170
|
-
label: a.label,
|
|
171
|
-
typeRef: a.typeRef || "string",
|
|
172
|
-
name: a.name
|
|
173
|
-
})),
|
|
174
|
-
rules: te(e, t, i)
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function ie(e, t, i, a) {
|
|
180
|
-
var m, h, l;
|
|
181
|
-
const r = (m = t == null ? void 0 : t.ui) == null ? void 0 : m.bpmnEmit;
|
|
182
|
-
if (!r)
|
|
183
|
-
return {
|
|
184
|
-
serviceTasks: [
|
|
185
|
-
{
|
|
186
|
-
id: e.id,
|
|
187
|
-
name: (t == null ? void 0 : t.name) || e.descriptorType,
|
|
188
|
-
configuration: Array.isArray(t == null ? void 0 : t.configuration) ? t.configuration : [],
|
|
189
|
-
// Strip display-only keys (_optionLabels, _conditionConfig) — the
|
|
190
|
-
// backend wants the clean task input only.
|
|
191
|
-
input: H(e.formData)
|
|
192
|
-
}
|
|
193
|
-
],
|
|
194
|
-
gateways: [],
|
|
195
|
-
callActivities: [],
|
|
196
|
-
templateFlows: [],
|
|
197
|
-
dmn: null,
|
|
198
|
-
bpmnEntry: e.id,
|
|
199
|
-
bpmnExit: e.id,
|
|
200
|
-
outgoingConditions: {},
|
|
201
|
-
endsNeeded: /* @__PURE__ */ new Set()
|
|
202
|
-
};
|
|
203
|
-
const s = {
|
|
204
|
-
id: e.id,
|
|
205
|
-
endFailure: a.endEventIds.failure,
|
|
206
|
-
endRejected: a.endEventIds.rejected,
|
|
207
|
-
endSuccess: a.endEventIds.success
|
|
208
|
-
};
|
|
209
|
-
if (r.conditionEmit) {
|
|
210
|
-
const u = ne(r.conditionEmit, e, a.conditionPathPrefix);
|
|
211
|
-
s.pass = u ? `\${${u}}` : "", s.fail = u ? `\${!(${u})}` : "";
|
|
212
|
-
}
|
|
213
|
-
const g = { task: t, slot: e, ctx: i }, c = (r.serviceTasks || []).map((u) => ({
|
|
214
|
-
id: D(u.idTemplate, s),
|
|
215
|
-
name: u.name,
|
|
216
|
-
flowableClass: u.flowableClass,
|
|
217
|
-
extensionElements: {
|
|
218
|
-
fields: (u.extensionFields || []).map((T) => ({
|
|
219
|
-
name: T.name,
|
|
220
|
-
stringValue: Z(T, g)
|
|
221
|
-
}))
|
|
222
|
-
}
|
|
223
|
-
}));
|
|
224
|
-
let d = null;
|
|
225
|
-
const E = [];
|
|
226
|
-
r.gateway && (d = D(r.gateway.idTemplate, s), s.gateway = d, E.push({ id: d, name: r.gateway.name }));
|
|
227
|
-
const v = /* @__PURE__ */ new Set(), f = (r.templateFlows || []).map((u) => {
|
|
228
|
-
const T = D(u.from, s), j = D(u.to, s);
|
|
229
|
-
return j === a.endEventIds.failure && v.add(a.endEventIds.failure), j === a.endEventIds.rejected && v.add(a.endEventIds.rejected), {
|
|
230
|
-
id: u.idTemplate ? D(u.idTemplate, s) : `${T}-to-${j}`,
|
|
231
|
-
sourceRef: T,
|
|
232
|
-
targetRef: j,
|
|
233
|
-
conditionExpression: u.condition ? D(u.condition, s) : null
|
|
234
|
-
};
|
|
235
|
-
}), y = [], C = r.dmnEmit ? se(r.dmnEmit, e, a.conditionPathPrefix) : null, b = ((h = c[0]) == null ? void 0 : h.id) ?? e.id, o = d ?? ((l = c[c.length - 1]) == null ? void 0 : l.id) ?? e.id, p = {};
|
|
236
|
-
return Object.keys(r.outgoingConditions || {}).forEach((u) => {
|
|
237
|
-
p[u] = D(
|
|
238
|
-
r.outgoingConditions[u],
|
|
239
|
-
s
|
|
240
|
-
);
|
|
241
|
-
}), {
|
|
242
|
-
serviceTasks: c,
|
|
243
|
-
gateways: E,
|
|
244
|
-
callActivities: y,
|
|
245
|
-
templateFlows: f,
|
|
246
|
-
dmn: C,
|
|
247
|
-
bpmnEntry: b,
|
|
248
|
-
bpmnExit: o,
|
|
249
|
-
outgoingConditions: p,
|
|
250
|
-
endsNeeded: v
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
function ae(e) {
|
|
254
|
-
var W, B, V, J, M, G, U;
|
|
255
|
-
const { state: t, tasksByKey: i, context: a, config: r } = e, s = {
|
|
256
|
-
...S,
|
|
257
|
-
...r ?? {},
|
|
258
|
-
triggerToCategory: { ...S.triggerToCategory, ...(r == null ? void 0 : r.triggerToCategory) ?? {} },
|
|
259
|
-
schedulerEventTypes: (r == null ? void 0 : r.schedulerEventTypes) ?? S.schedulerEventTypes,
|
|
260
|
-
endEventIds: { ...S.endEventIds, ...(r == null ? void 0 : r.endEventIds) ?? {} },
|
|
261
|
-
endEventNames: { ...S.endEventNames, ...(r == null ? void 0 : r.endEventNames) ?? {} },
|
|
262
|
-
triggerConfigDefaults: (r == null ? void 0 : r.triggerConfigDefaults) ?? S.triggerConfigDefaults
|
|
263
|
-
}, g = Array.isArray(t == null ? void 0 : t.slots) ? t.slots : [], c = g.find((n) => n.kind === "triggerFixed"), d = (W = c == null ? void 0 : c.nodeData) == null ? void 0 : W.eventType, E = ((B = c == null ? void 0 : c.nodeData) == null ? void 0 : B.type) || "event", v = (V = c == null ? void 0 : c.nodeData) == null ? void 0 : V.sources, f = Array.isArray(v) ? v.map(
|
|
264
|
-
(n) => typeof n == "string" ? n : (n == null ? void 0 : n.value) ?? (n == null ? void 0 : n.key) ?? ""
|
|
265
|
-
).filter(Boolean) : [], y = s.triggerToCategory[d ?? ""] ?? s.defaultWorkflowCategory, b = !!d && s.schedulerEventTypes.includes(d) ? ["SCHEDULER"] : f, o = (n) => ie(n, i[n.descriptorType ?? ""] ?? {}, a, s), p = (n) => n.kind === "filter" || n.kind === "approval", m = (t == null ? void 0 : t.branches) ?? {}, l = g.filter(q).map((n) => ({ slot: n, emit: o(n) })), u = [];
|
|
266
|
-
l.forEach(({ slot: n, emit: w }) => {
|
|
267
|
-
!p(n) || !m[n.id] || Object.entries(m[n.id]).forEach(([x, N]) => {
|
|
268
|
-
const $ = (Array.isArray(N) ? N : []).filter(q);
|
|
269
|
-
u.push({
|
|
270
|
-
filterEmit: w,
|
|
271
|
-
branchKey: x,
|
|
272
|
-
chain: $.map((I) => ({ slot: I, emit: o(I) }))
|
|
273
|
-
});
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
const T = [], j = [], R = [], k = [], K = [], O = /* @__PURE__ */ new Set(), L = (n) => {
|
|
277
|
-
T.push(...n.serviceTasks), j.push(...n.gateways), R.push(...n.callActivities), k.push(...n.templateFlows), n.dmn && K.push(n.dmn), n.endsNeeded.forEach((w) => O.add(w));
|
|
278
|
-
};
|
|
279
|
-
l.forEach(({ emit: n }) => L(n)), u.forEach((n) => n.chain.forEach(({ emit: w }) => L(w)));
|
|
280
|
-
const P = [], A = (n, w, x) => P.push({ id: `${n}-to-${w}`, sourceRef: n, targetRef: w, conditionExpression: x });
|
|
281
|
-
if (l.length > 0) {
|
|
282
|
-
A(s.startEventId, l[0].emit.bpmnEntry, null);
|
|
283
|
-
for (let w = 0; w < l.length - 1; w += 1) {
|
|
284
|
-
const x = l[w].emit, N = l[w + 1].emit, $ = x.outgoingConditions.success ?? x.outgoingConditions.pass ?? x.outgoingConditions.approved ?? null;
|
|
285
|
-
A(x.bpmnExit, N.bpmnEntry, $);
|
|
286
|
-
}
|
|
287
|
-
const n = l[l.length - 1];
|
|
288
|
-
if (p(n.slot) && m[n.slot.id]) {
|
|
289
|
-
const w = n.emit.bpmnExit, x = ((G = (M = (J = i[n.slot.descriptorType ?? ""]) == null ? void 0 : J.ui) == null ? void 0 : M.bpmnEmit) == null ? void 0 : G.branchEnds) ?? {}, N = ($) => {
|
|
290
|
-
const I = x[$] ?? "success", F = I === "failure" ? s.endEventIds.failure : I === "rejected" ? s.endEventIds.rejected : s.endEventIds.success;
|
|
291
|
-
return F !== s.endEventIds.success && O.add(F), F;
|
|
292
|
-
};
|
|
293
|
-
u.filter(($) => $.filterEmit === n.emit).forEach(($) => {
|
|
294
|
-
const I = n.emit.outgoingConditions[$.branchKey] ?? null, F = N($.branchKey);
|
|
295
|
-
if ($.chain.length === 0) {
|
|
296
|
-
A(w, F, I);
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
A(w, $.chain[0].emit.bpmnEntry, I);
|
|
300
|
-
for (let _ = 0; _ < $.chain.length - 1; _ += 1)
|
|
301
|
-
A($.chain[_].emit.bpmnExit, $.chain[_ + 1].emit.bpmnEntry, null);
|
|
302
|
-
A($.chain[$.chain.length - 1].emit.bpmnExit, F, null);
|
|
303
|
-
});
|
|
304
|
-
} else
|
|
305
|
-
A(n.emit.bpmnExit, s.endEventIds.success, null);
|
|
306
|
-
} else
|
|
307
|
-
P.push({
|
|
308
|
-
id: `${s.startEventId}-to-${s.endEventIds.success}`,
|
|
309
|
-
sourceRef: s.startEventId,
|
|
310
|
-
targetRef: s.endEventIds.success,
|
|
311
|
-
conditionExpression: null
|
|
312
|
-
});
|
|
313
|
-
const z = [
|
|
314
|
-
{
|
|
315
|
-
id: s.endEventIds.success,
|
|
316
|
-
name: s.endEventNames.success,
|
|
317
|
-
executionListener: null
|
|
318
|
-
},
|
|
319
|
-
...O.has(s.endEventIds.failure) ? [{ id: s.endEventIds.failure, name: s.endEventNames.failure }] : [],
|
|
320
|
-
...O.has(s.endEventIds.rejected) ? [{ id: s.endEventIds.rejected, name: s.endEventNames.rejected }] : []
|
|
321
|
-
], Q = {
|
|
322
|
-
id: s.startEventId,
|
|
323
|
-
name: "Start",
|
|
324
|
-
...E === "event" ? {
|
|
325
|
-
messageEventDefinition: {
|
|
326
|
-
messageRef: `msg_${(d || "EVENT").toLowerCase()}_${b.length > 0 ? b.join("_").toLowerCase() : "default"}_${a.customerKey}`
|
|
327
|
-
}
|
|
328
|
-
} : {}
|
|
329
|
-
};
|
|
330
|
-
return {
|
|
331
|
-
canvasState: {
|
|
332
|
-
slots: g,
|
|
333
|
-
branches: (t == null ? void 0 : t.branches) ?? {}
|
|
334
|
-
},
|
|
335
|
-
bpmn: {
|
|
336
|
-
customerId: `${a.customerKey}`,
|
|
337
|
-
workflowCategory: y,
|
|
338
|
-
sources: b,
|
|
339
|
-
process: {
|
|
340
|
-
name: a.workflowName,
|
|
341
|
-
isExecutable: "true"
|
|
342
|
-
},
|
|
343
|
-
startEvent: Q,
|
|
344
|
-
endEvent: z,
|
|
345
|
-
sequenceFlows: [...P, ...k],
|
|
346
|
-
exclusiveGateways: j,
|
|
347
|
-
serviceTasks: T,
|
|
348
|
-
callActivities: R
|
|
349
|
-
},
|
|
350
|
-
...E === "event" ? {
|
|
351
|
-
message: {
|
|
352
|
-
id: `msg_${(d || "event").toLowerCase()}_${b.length > 0 ? b.join("_").toLowerCase() : "default"}_${a.customerKey}`,
|
|
353
|
-
name: `msg_${(d || "event").toLowerCase()}_${b.length > 0 ? b.join("_").toLowerCase() : "default"}_${a.customerKey}`
|
|
354
|
-
},
|
|
355
|
-
dmns: K
|
|
356
|
-
} : {
|
|
357
|
-
// Non-event trigger (e.g. scheduler). The saved config lives in the
|
|
358
|
-
// trigger slot's formData under the trigger TYPE key — dotted field
|
|
359
|
-
// ids like `scheduler.timeZone` get nested under `scheduler` on save.
|
|
360
|
-
// eventType/`type` is the trigger TYPE ('scheduler'), NOT the workflow
|
|
361
|
-
// category. Host-supplied defaults fill the canonical shape; saved
|
|
362
|
-
// values override; internal `_*` keys are stripped.
|
|
363
|
-
eventConfig: [
|
|
364
|
-
{
|
|
365
|
-
eventType: E,
|
|
366
|
-
config: {
|
|
367
|
-
type: E,
|
|
368
|
-
...s.triggerConfigDefaults[E] ?? {},
|
|
369
|
-
...H(
|
|
370
|
-
(U = c == null ? void 0 : c.formData) == null ? void 0 : U[E]
|
|
371
|
-
)
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
]
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
export {
|
|
379
|
-
ae as b
|
|
380
|
-
};
|
|
381
|
-
//# sourceMappingURL=buildBackendPayload-C9xBGiLv.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const S={triggerToCategory:{},schedulerEventTypes:[],conditionPathPrefix:"",defaultWorkflowCategory:"",endEventIds:{success:"endEventSuccess",failure:"endEventFailure",rejected:"endEventRejected"},endEventNames:{success:"Success",failure:"Failure",rejected:"Rejected"},startEventId:"startEvent",triggerConfigDefaults:{}};function H(e){if(!e||typeof e!="object")return{};const t={};return Object.keys(e).forEach(i=>{i.startsWith("_")||(t[i]=e[i])}),t}const X=new Set(["start","end","triggerFixed","addTrigger","addStep"]),q=e=>!!e&&!X.has(String(e.kind??""));function D(e,t){return e==null?"":String(e).replace(/\$\{(\w+)\}/g,(i,a)=>Object.prototype.hasOwnProperty.call(t,a)?String(t[a]):i)}function Y(e,t){var s,g,c,d,E;if(!e||typeof e!="object")return"";const{from:i,key:a,value:r}=e;return i==="literal"?r===void 0?"":String(r):i==="task"?String(((s=t.task)==null?void 0:s[a??""])??""):i==="ctx"?String(((g=t.ctx)==null?void 0:g[a??""])??""):i==="slot"?String(((c=t.slot)==null?void 0:c[a??""])??""):i==="formData"?String(((E=(d=t.slot)==null?void 0:d.formData)==null?void 0:E[a??""])??""):""}function Z(e,t){var a,r,s;const i=e==null?void 0:e.source;if(!i)return"";if(i.type==="literal")return typeof i.value=="string"?i.value:JSON.stringify(i.value??"");if(i.type==="json"||i.type==="taskConfig"){const g=i.shape||{},c={};return Object.keys(g).forEach(d=>{c[d]=Y(g[d],t)}),JSON.stringify(c)}if(i.type==="formData"){if(i.passthrough){const g=new Set(i.exclude||[]),c={},d=((a=t.slot)==null?void 0:a.formData)??{};Object.keys(d).forEach(v=>{v.startsWith("_")||g.has(v)||(c[v]=d[v])});const E=i.wrapKey?{[i.wrapKey]:c}:c;return JSON.stringify(E)}return String(((s=(r=t.slot)==null?void 0:r.formData)==null?void 0:s[i.key??""])??"")}return""}function ee(e,t){if(!(!e||typeof e!="object"||!t))return t.split(".").reduce((i,a)=>{if(!(i==null||typeof i!="object"))return i[a]},e)}function te(e,t,i){var b;const a=e.operatorMap||{},r=e.valuesField||"groups",s=o=>{const p=a[String((o==null?void 0:o.operator)??"")]??"==",m=`${i}.${(o==null?void 0:o.key)??(o==null?void 0:o.field)??""}`,h=`'${String((o==null?void 0:o.value)??"")}'`;return p.startsWith(".")?`${m}${p}(${h})`:p.startsWith("!.")?`!${m}${p.slice(1)}(${h})`:`${m} ${p} ${h}`},g=o=>{var u,T;const p=Array.isArray(o)?o:[];if(p.length===0)return null;const m=p.map(s),l=((u=p[0])==null?void 0:u.connector)==="or"||((T=p[0])==null?void 0:T.logicalOperator)==="OR"?"||":"&&";return m.join(` ${l} `)},c=[];let d=1;const E=(o,p)=>{c.push({id:`rule${d}`,inputEntries:[{id:`rule${d}InputEntry1`,text:o?`\${(${o})}`:""}],outputEntries:[{id:`rule${d}OutputEntry1`,text:`"${p}"`}]}),d+=1},v=Array.isArray((b=t==null?void 0:t.formData)==null?void 0:b.groupBlocks)?t.formData.groupBlocks:[];if(v.length>0)return v.forEach(o=>{const p=Array.isArray(o==null?void 0:o[r])?o[r]:[],m=g(o==null?void 0:o.conditions);p.forEach(h=>E(m,h))}),c;const f=(t==null?void 0:t.formData)??{},y=f._conditionConfig??f.conditionConfig,C=[];if(y&&typeof y=="object"&&Object.keys(y).forEach(o=>{const p=y[o],m=g(p);m&&C.push(m);const h=Object.prototype.hasOwnProperty.call(f,o)?f[o]:ee(f,o);Array.isArray(h)?h.forEach(l=>{const u=typeof l=="object"&&l!==null?l.value??l.label??l:l;E(m,u)}):h!=null&&h!==""?E(m,h):m&&E(m,"")}),e.fallback==="negation"){const o=e.fallbackField||"fallback",p=f[o],m=Array.isArray(p)?p:p!=null&&p!==""?[p]:[];if(m.length>0){const h=C.length>0?`!(${C.map(l=>`(${l})`).join(" || ")})`:null;m.forEach(l=>{const u=typeof l=="object"&&l!==null?l.value??l.label??l:l;E(h,u)})}}return c}function ne(e,t,i){var v;const a=e.operatorMap||{},r=e.pathPrefix??i,s=e.conditionsField||"conditions",g=(v=t==null?void 0:t.formData)==null?void 0:v[s],c=Array.isArray(g)?g:[];if(c.length===0)return"";const d=f=>{const y=a[String((f==null?void 0:f.operator)??"")]??"==",C=`${r}.${(f==null?void 0:f.key)??(f==null?void 0:f.field)??""}`,b=`'${String((f==null?void 0:f.value)??"")}'`;return y.startsWith("!.")?`!${C}${y.slice(1)}(${b})`:y.startsWith(".")?`${C}${y}(${b})`:`${C} ${y} ${b}`};let E=d(c[0]);for(let f=1;f<c.length;f+=1){const y=c[f-1],C=(y==null?void 0:y.connector)==="or"||(y==null?void 0:y.logicalOperator)==="OR";E+=` ${C?"||":"&&"} ${d(c[f])}`}return E}function se(e,t,i){return{mappings:[],name:e.tableName,decision:{id:e.tableName,name:e.tableName,decisionTable:{id:`decisionTable_${e.tableName}`,hitPolicy:e.hitPolicy||"FIRST",inputs:[{id:`input_${e.tableName}`,inputExpression:{id:`inputExpr_${e.tableName}`,typeRef:"string",text:e.inputExpr}}],outputs:(e.outputs||[]).map(a=>({id:a.id,label:a.label,typeRef:a.typeRef||"string",name:a.name})),rules:te(e,t,i)}}}}function ie(e,t,i,a){var m,h,l;const r=(m=t==null?void 0:t.ui)==null?void 0:m.bpmnEmit;if(!r)return{serviceTasks:[{id:e.id,name:(t==null?void 0:t.name)||e.descriptorType,configuration:Array.isArray(t==null?void 0:t.configuration)?t.configuration:[],input:H(e.formData)}],gateways:[],callActivities:[],templateFlows:[],dmn:null,bpmnEntry:e.id,bpmnExit:e.id,outgoingConditions:{},endsNeeded:new Set};const s={id:e.id,endFailure:a.endEventIds.failure,endRejected:a.endEventIds.rejected,endSuccess:a.endEventIds.success};if(r.conditionEmit){const u=ne(r.conditionEmit,e,a.conditionPathPrefix);s.pass=u?`\${${u}}`:"",s.fail=u?`\${!(${u})}`:""}const g={task:t,slot:e,ctx:i},c=(r.serviceTasks||[]).map(u=>({id:D(u.idTemplate,s),name:u.name,flowableClass:u.flowableClass,extensionElements:{fields:(u.extensionFields||[]).map(T=>({name:T.name,stringValue:Z(T,g)}))}}));let d=null;const E=[];r.gateway&&(d=D(r.gateway.idTemplate,s),s.gateway=d,E.push({id:d,name:r.gateway.name}));const v=new Set,f=(r.templateFlows||[]).map(u=>{const T=D(u.from,s),j=D(u.to,s);return j===a.endEventIds.failure&&v.add(a.endEventIds.failure),j===a.endEventIds.rejected&&v.add(a.endEventIds.rejected),{id:u.idTemplate?D(u.idTemplate,s):`${T}-to-${j}`,sourceRef:T,targetRef:j,conditionExpression:u.condition?D(u.condition,s):null}}),y=[],C=r.dmnEmit?se(r.dmnEmit,e,a.conditionPathPrefix):null,b=((h=c[0])==null?void 0:h.id)??e.id,o=d??((l=c[c.length-1])==null?void 0:l.id)??e.id,p={};return Object.keys(r.outgoingConditions||{}).forEach(u=>{p[u]=D(r.outgoingConditions[u],s)}),{serviceTasks:c,gateways:E,callActivities:y,templateFlows:f,dmn:C,bpmnEntry:b,bpmnExit:o,outgoingConditions:p,endsNeeded:v}}function re(e){var W,B,V,J,M,G,U;const{state:t,tasksByKey:i,context:a,config:r}=e,s={...S,...r??{},triggerToCategory:{...S.triggerToCategory,...(r==null?void 0:r.triggerToCategory)??{}},schedulerEventTypes:(r==null?void 0:r.schedulerEventTypes)??S.schedulerEventTypes,endEventIds:{...S.endEventIds,...(r==null?void 0:r.endEventIds)??{}},endEventNames:{...S.endEventNames,...(r==null?void 0:r.endEventNames)??{}},triggerConfigDefaults:(r==null?void 0:r.triggerConfigDefaults)??S.triggerConfigDefaults},g=Array.isArray(t==null?void 0:t.slots)?t.slots:[],c=g.find(n=>n.kind==="triggerFixed"),d=(W=c==null?void 0:c.nodeData)==null?void 0:W.eventType,E=((B=c==null?void 0:c.nodeData)==null?void 0:B.type)||"event",v=(V=c==null?void 0:c.nodeData)==null?void 0:V.sources,f=Array.isArray(v)?v.map(n=>typeof n=="string"?n:(n==null?void 0:n.value)??(n==null?void 0:n.key)??"").filter(Boolean):[],y=s.triggerToCategory[d??""]??s.defaultWorkflowCategory,b=!!d&&s.schedulerEventTypes.includes(d)?["SCHEDULER"]:f,o=n=>ie(n,i[n.descriptorType??""]??{},a,s),p=n=>n.kind==="filter"||n.kind==="approval",m=(t==null?void 0:t.branches)??{},l=g.filter(q).map(n=>({slot:n,emit:o(n)})),u=[];l.forEach(({slot:n,emit:w})=>{!p(n)||!m[n.id]||Object.entries(m[n.id]).forEach(([I,N])=>{const $=(Array.isArray(N)?N:[]).filter(q);u.push({filterEmit:w,branchKey:I,chain:$.map(x=>({slot:x,emit:o(x)}))})})});const T=[],j=[],R=[],k=[],K=[],O=new Set,L=n=>{T.push(...n.serviceTasks),j.push(...n.gateways),R.push(...n.callActivities),k.push(...n.templateFlows),n.dmn&&K.push(n.dmn),n.endsNeeded.forEach(w=>O.add(w))};l.forEach(({emit:n})=>L(n)),u.forEach(n=>n.chain.forEach(({emit:w})=>L(w)));const P=[],A=(n,w,I)=>P.push({id:`${n}-to-${w}`,sourceRef:n,targetRef:w,conditionExpression:I});if(l.length>0){A(s.startEventId,l[0].emit.bpmnEntry,null);for(let w=0;w<l.length-1;w+=1){const I=l[w].emit,N=l[w+1].emit,$=I.outgoingConditions.success??I.outgoingConditions.pass??I.outgoingConditions.approved??null;A(I.bpmnExit,N.bpmnEntry,$)}const n=l[l.length-1];if(p(n.slot)&&m[n.slot.id]){const w=n.emit.bpmnExit,I=((G=(M=(J=i[n.slot.descriptorType??""])==null?void 0:J.ui)==null?void 0:M.bpmnEmit)==null?void 0:G.branchEnds)??{},N=$=>{const x=I[$]??"success",F=x==="failure"?s.endEventIds.failure:x==="rejected"?s.endEventIds.rejected:s.endEventIds.success;return F!==s.endEventIds.success&&O.add(F),F};u.filter($=>$.filterEmit===n.emit).forEach($=>{const x=n.emit.outgoingConditions[$.branchKey]??null,F=N($.branchKey);if($.chain.length===0){A(w,F,x);return}A(w,$.chain[0].emit.bpmnEntry,x);for(let _=0;_<$.chain.length-1;_+=1)A($.chain[_].emit.bpmnExit,$.chain[_+1].emit.bpmnEntry,null);A($.chain[$.chain.length-1].emit.bpmnExit,F,null)})}else A(n.emit.bpmnExit,s.endEventIds.success,null)}else P.push({id:`${s.startEventId}-to-${s.endEventIds.success}`,sourceRef:s.startEventId,targetRef:s.endEventIds.success,conditionExpression:null});const z=[{id:s.endEventIds.success,name:s.endEventNames.success,executionListener:null},...O.has(s.endEventIds.failure)?[{id:s.endEventIds.failure,name:s.endEventNames.failure}]:[],...O.has(s.endEventIds.rejected)?[{id:s.endEventIds.rejected,name:s.endEventNames.rejected}]:[]],Q={id:s.startEventId,name:"Start",...E==="event"?{messageEventDefinition:{messageRef:`msg_${(d||"EVENT").toLowerCase()}_${b.length>0?b.join("_").toLowerCase():"default"}_${a.customerKey}`}}:{}};return{canvasState:{slots:g,branches:(t==null?void 0:t.branches)??{}},bpmn:{customerId:`${a.customerKey}`,workflowCategory:y,sources:b,process:{name:a.workflowName,isExecutable:"true"},startEvent:Q,endEvent:z,sequenceFlows:[...P,...k],exclusiveGateways:j,serviceTasks:T,callActivities:R},...E==="event"?{message:{id:`msg_${(d||"event").toLowerCase()}_${b.length>0?b.join("_").toLowerCase():"default"}_${a.customerKey}`,name:`msg_${(d||"event").toLowerCase()}_${b.length>0?b.join("_").toLowerCase():"default"}_${a.customerKey}`},dmns:K}:{eventConfig:[{eventType:E,config:{type:E,...s.triggerConfigDefaults[E]??{},...H((U=c==null?void 0:c.formData)==null?void 0:U[E])}}]}}}exports.buildBackendPayload=re;
|
|
2
|
-
//# sourceMappingURL=buildBackendPayload-ty2Yn_kg.js.map
|