@aranzatech/diagrams-bpmn 0.1.0
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/chunk-23B2IGK5.js +24 -0
- package/dist/chunk-23B2IGK5.js.map +1 -0
- package/dist/chunk-3AFZDIMQ.js +286 -0
- package/dist/chunk-3AFZDIMQ.js.map +1 -0
- package/dist/chunk-4OAEWYYU.js +579 -0
- package/dist/chunk-4OAEWYYU.js.map +1 -0
- package/dist/chunk-57LA2WSJ.js +476 -0
- package/dist/chunk-57LA2WSJ.js.map +1 -0
- package/dist/chunk-6TUC5QX5.js +491 -0
- package/dist/chunk-6TUC5QX5.js.map +1 -0
- package/dist/chunk-MLUJKUTG.js +86 -0
- package/dist/chunk-MLUJKUTG.js.map +1 -0
- package/dist/chunk-NXMUX67A.js +1443 -0
- package/dist/chunk-NXMUX67A.js.map +1 -0
- package/dist/edges/index.cjs +300 -0
- package/dist/edges/index.cjs.map +1 -0
- package/dist/edges/index.d.cts +17 -0
- package/dist/edges/index.d.ts +17 -0
- package/dist/edges/index.js +4 -0
- package/dist/edges/index.js.map +1 -0
- package/dist/elements/index.cjs +587 -0
- package/dist/elements/index.cjs.map +1 -0
- package/dist/elements/index.d.cts +20 -0
- package/dist/elements/index.d.ts +20 -0
- package/dist/elements/index.js +4 -0
- package/dist/elements/index.js.map +1 -0
- package/dist/index.cjs +3442 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +67 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/index.cjs +1487 -0
- package/dist/nodes/index.cjs.map +1 -0
- package/dist/nodes/index.d.cts +45 -0
- package/dist/nodes/index.d.ts +45 -0
- package/dist/nodes/index.js +4 -0
- package/dist/nodes/index.js.map +1 -0
- package/dist/simulation/index.cjs +483 -0
- package/dist/simulation/index.cjs.map +1 -0
- package/dist/simulation/index.d.cts +62 -0
- package/dist/simulation/index.d.ts +62 -0
- package/dist/simulation/index.js +3 -0
- package/dist/simulation/index.js.map +1 -0
- package/dist/types-CxzazgBX.d.cts +111 -0
- package/dist/types-CxzazgBX.d.ts +111 -0
- package/dist/xml/index.cjs +1068 -0
- package/dist/xml/index.cjs.map +1 -0
- package/dist/xml/index.d.cts +24 -0
- package/dist/xml/index.d.ts +24 -0
- package/dist/xml/index.js +4 -0
- package/dist/xml/index.js.map +1 -0
- package/package.json +84 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export { BPMN_ELEMENT_CATALOG, acceptsBoundaryEvents, getElementMeta, getHandlePolicy, getOrientation, isChoreographyType, isContainerType, isConversationType, isDataType, isEventType, isGatewayType, isTaskType, supportsCollapse, supportsMarkers } from './elements/index.cjs';
|
|
2
|
+
export { B as BpmnCategory, a as BpmnEdgeData, b as BpmnEdgeType, c as BpmnElementMeta, d as BpmnElementType, e as BpmnEventSemantics, f as BpmnHandlePolicy, g as BpmnNodeData, h as BpmnOrientation, E as EventTrigger, S as SubProcessVariant, T as TaskMarker } from './types-CxzazgBX.cjs';
|
|
3
|
+
export { AnnotationNode, BPMN_NODE_TYPES, BoundaryEventNode, CallChoreographyNode, CallConversationNode, ChoreographyTaskNode, ConversationNode, DataInputNode, DataObjectNode, DataObjectReferenceNode, DataOutputNode, DataStoreNode, DataStoreReferenceNode, EndEventNode, GatewayNode, GroupNode, IntermediateCatchEventNode, IntermediateThrowEventNode, LaneNode, PoolNode, StartEventNode, SubChoreographyNode, SubConversationNode, SubProcessNode, TaskNode } from './nodes/index.cjs';
|
|
4
|
+
export { AssociationEdge, BPMN_EDGE_TYPES, ConversationLinkEdge, DataAssociationEdge, MessageFlowEdge, SequenceFlowEdge } from './edges/index.cjs';
|
|
5
|
+
export { BpmnExportOptions, BpmnImportResult, BpmnRFEdge, BpmnRFNode, parseBpmnXml, serializeBpmnXml } from './xml/index.cjs';
|
|
6
|
+
import { SimulationState, SimDiagram } from './simulation/index.cjs';
|
|
7
|
+
export { SimEdge, SimLogEntry, SimLogType, SimNode, SimStatus, SimToken, SimVariables, createSimulation, fire, getFireable, isCompleted, setVariable, tick } from './simulation/index.cjs';
|
|
8
|
+
import 'react/jsx-runtime';
|
|
9
|
+
import '@xyflow/react';
|
|
10
|
+
|
|
11
|
+
type SimMode = "preview" | "live";
|
|
12
|
+
type SimVariables = Record<string, string | number | boolean>;
|
|
13
|
+
interface SimulationAdapter {
|
|
14
|
+
readonly mode: SimMode;
|
|
15
|
+
/** Initialize the simulation. Places tokens (preview) or starts the process instance (live). */
|
|
16
|
+
start(variables?: SimVariables): Promise<SimulationState>;
|
|
17
|
+
/** Advance automatic elements. No-op in live mode — the engine drives execution. */
|
|
18
|
+
tick(): Promise<SimulationState>;
|
|
19
|
+
/**
|
|
20
|
+
* Manually fire an element (complete a task, trigger a catch event).
|
|
21
|
+
* In live mode: delegates to the backend, which completes the Flowable task.
|
|
22
|
+
*/
|
|
23
|
+
fire(elementId: string, variables?: SimVariables): Promise<SimulationState>;
|
|
24
|
+
/** Returns element IDs that can be manually fired right now. */
|
|
25
|
+
getFireable(): Promise<string[]>;
|
|
26
|
+
/** Returns the last known SimulationState snapshot without a network call. */
|
|
27
|
+
getState(): SimulationState;
|
|
28
|
+
isCompleted(): boolean;
|
|
29
|
+
}
|
|
30
|
+
declare function createPreviewAdapter(diagram: SimDiagram, initialVariables?: SimVariables): SimulationAdapter;
|
|
31
|
+
|
|
32
|
+
interface FlowableProcessInstance {
|
|
33
|
+
id: string;
|
|
34
|
+
processDefinitionId: string;
|
|
35
|
+
processDefinitionKey: string;
|
|
36
|
+
businessKey?: string;
|
|
37
|
+
suspended: boolean;
|
|
38
|
+
ended: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface FlowableTask {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
/** Maps to the BPMN element id in the diagram. */
|
|
44
|
+
taskDefinitionKey: string;
|
|
45
|
+
processInstanceId: string;
|
|
46
|
+
assignee?: string;
|
|
47
|
+
dueDate?: string;
|
|
48
|
+
priority: number;
|
|
49
|
+
formKey?: string;
|
|
50
|
+
}
|
|
51
|
+
interface FlowableVariable {
|
|
52
|
+
name: string;
|
|
53
|
+
type: "string" | "integer" | "long" | "double" | "boolean" | "date";
|
|
54
|
+
value: string | number | boolean | null;
|
|
55
|
+
}
|
|
56
|
+
interface FlowableHistoryEntry {
|
|
57
|
+
activityId: string;
|
|
58
|
+
activityName?: string;
|
|
59
|
+
activityType: string;
|
|
60
|
+
processInstanceId: string;
|
|
61
|
+
startTime: string;
|
|
62
|
+
endTime?: string;
|
|
63
|
+
durationInMillis?: number;
|
|
64
|
+
assignee?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { type FlowableHistoryEntry, type FlowableProcessInstance, type FlowableTask, type FlowableVariable, SimDiagram, type SimMode, type SimulationAdapter, SimulationState, createPreviewAdapter };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export { BPMN_ELEMENT_CATALOG, acceptsBoundaryEvents, getElementMeta, getHandlePolicy, getOrientation, isChoreographyType, isContainerType, isConversationType, isDataType, isEventType, isGatewayType, isTaskType, supportsCollapse, supportsMarkers } from './elements/index.js';
|
|
2
|
+
export { B as BpmnCategory, a as BpmnEdgeData, b as BpmnEdgeType, c as BpmnElementMeta, d as BpmnElementType, e as BpmnEventSemantics, f as BpmnHandlePolicy, g as BpmnNodeData, h as BpmnOrientation, E as EventTrigger, S as SubProcessVariant, T as TaskMarker } from './types-CxzazgBX.js';
|
|
3
|
+
export { AnnotationNode, BPMN_NODE_TYPES, BoundaryEventNode, CallChoreographyNode, CallConversationNode, ChoreographyTaskNode, ConversationNode, DataInputNode, DataObjectNode, DataObjectReferenceNode, DataOutputNode, DataStoreNode, DataStoreReferenceNode, EndEventNode, GatewayNode, GroupNode, IntermediateCatchEventNode, IntermediateThrowEventNode, LaneNode, PoolNode, StartEventNode, SubChoreographyNode, SubConversationNode, SubProcessNode, TaskNode } from './nodes/index.js';
|
|
4
|
+
export { AssociationEdge, BPMN_EDGE_TYPES, ConversationLinkEdge, DataAssociationEdge, MessageFlowEdge, SequenceFlowEdge } from './edges/index.js';
|
|
5
|
+
export { BpmnExportOptions, BpmnImportResult, BpmnRFEdge, BpmnRFNode, parseBpmnXml, serializeBpmnXml } from './xml/index.js';
|
|
6
|
+
import { SimulationState, SimDiagram } from './simulation/index.js';
|
|
7
|
+
export { SimEdge, SimLogEntry, SimLogType, SimNode, SimStatus, SimToken, SimVariables, createSimulation, fire, getFireable, isCompleted, setVariable, tick } from './simulation/index.js';
|
|
8
|
+
import 'react/jsx-runtime';
|
|
9
|
+
import '@xyflow/react';
|
|
10
|
+
|
|
11
|
+
type SimMode = "preview" | "live";
|
|
12
|
+
type SimVariables = Record<string, string | number | boolean>;
|
|
13
|
+
interface SimulationAdapter {
|
|
14
|
+
readonly mode: SimMode;
|
|
15
|
+
/** Initialize the simulation. Places tokens (preview) or starts the process instance (live). */
|
|
16
|
+
start(variables?: SimVariables): Promise<SimulationState>;
|
|
17
|
+
/** Advance automatic elements. No-op in live mode — the engine drives execution. */
|
|
18
|
+
tick(): Promise<SimulationState>;
|
|
19
|
+
/**
|
|
20
|
+
* Manually fire an element (complete a task, trigger a catch event).
|
|
21
|
+
* In live mode: delegates to the backend, which completes the Flowable task.
|
|
22
|
+
*/
|
|
23
|
+
fire(elementId: string, variables?: SimVariables): Promise<SimulationState>;
|
|
24
|
+
/** Returns element IDs that can be manually fired right now. */
|
|
25
|
+
getFireable(): Promise<string[]>;
|
|
26
|
+
/** Returns the last known SimulationState snapshot without a network call. */
|
|
27
|
+
getState(): SimulationState;
|
|
28
|
+
isCompleted(): boolean;
|
|
29
|
+
}
|
|
30
|
+
declare function createPreviewAdapter(diagram: SimDiagram, initialVariables?: SimVariables): SimulationAdapter;
|
|
31
|
+
|
|
32
|
+
interface FlowableProcessInstance {
|
|
33
|
+
id: string;
|
|
34
|
+
processDefinitionId: string;
|
|
35
|
+
processDefinitionKey: string;
|
|
36
|
+
businessKey?: string;
|
|
37
|
+
suspended: boolean;
|
|
38
|
+
ended: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface FlowableTask {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
/** Maps to the BPMN element id in the diagram. */
|
|
44
|
+
taskDefinitionKey: string;
|
|
45
|
+
processInstanceId: string;
|
|
46
|
+
assignee?: string;
|
|
47
|
+
dueDate?: string;
|
|
48
|
+
priority: number;
|
|
49
|
+
formKey?: string;
|
|
50
|
+
}
|
|
51
|
+
interface FlowableVariable {
|
|
52
|
+
name: string;
|
|
53
|
+
type: "string" | "integer" | "long" | "double" | "boolean" | "date";
|
|
54
|
+
value: string | number | boolean | null;
|
|
55
|
+
}
|
|
56
|
+
interface FlowableHistoryEntry {
|
|
57
|
+
activityId: string;
|
|
58
|
+
activityName?: string;
|
|
59
|
+
activityType: string;
|
|
60
|
+
processInstanceId: string;
|
|
61
|
+
startTime: string;
|
|
62
|
+
endTime?: string;
|
|
63
|
+
durationInMillis?: number;
|
|
64
|
+
assignee?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { type FlowableHistoryEntry, type FlowableProcessInstance, type FlowableTask, type FlowableVariable, SimDiagram, type SimMode, type SimulationAdapter, SimulationState, createPreviewAdapter };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { acceptsBoundaryEvents, getHandlePolicy, getOrientation, isChoreographyType, isContainerType, isConversationType, isDataType, isEventType, isGatewayType, isTaskType, supportsCollapse, supportsMarkers } from './chunk-MLUJKUTG.js';
|
|
2
|
+
export { AnnotationNode, BPMN_NODE_TYPES, BoundaryEventNode, CallChoreographyNode, CallConversationNode, ChoreographyTaskNode, ConversationNode, DataInputNode, DataObjectNode, DataObjectReferenceNode, DataOutputNode, DataStoreNode, DataStoreReferenceNode, EndEventNode, GatewayNode, GroupNode, IntermediateCatchEventNode, IntermediateThrowEventNode, LaneNode, PoolNode, StartEventNode, SubChoreographyNode, SubConversationNode, SubProcessNode, TaskNode } from './chunk-NXMUX67A.js';
|
|
3
|
+
export { AssociationEdge, BPMN_EDGE_TYPES, ConversationLinkEdge, DataAssociationEdge, MessageFlowEdge, SequenceFlowEdge } from './chunk-3AFZDIMQ.js';
|
|
4
|
+
import './chunk-23B2IGK5.js';
|
|
5
|
+
export { parseBpmnXml, serializeBpmnXml } from './chunk-4OAEWYYU.js';
|
|
6
|
+
export { BPMN_ELEMENT_CATALOG, getElementMeta } from './chunk-6TUC5QX5.js';
|
|
7
|
+
import { createSimulation, tick, fire, getFireable, isCompleted } from './chunk-57LA2WSJ.js';
|
|
8
|
+
export { createSimulation, fire, getFireable, isCompleted, setVariable, tick } from './chunk-57LA2WSJ.js';
|
|
9
|
+
|
|
10
|
+
// src/flowable/adapter.ts
|
|
11
|
+
var PreviewAdapter = class {
|
|
12
|
+
constructor(diagram, initialVariables = {}) {
|
|
13
|
+
this.diagram = diagram;
|
|
14
|
+
this.mode = "preview";
|
|
15
|
+
this.state = createSimulation(diagram, initialVariables);
|
|
16
|
+
}
|
|
17
|
+
async start(variables) {
|
|
18
|
+
this.state = tick(this.diagram, createSimulation(this.diagram, variables ?? {}));
|
|
19
|
+
return this.state;
|
|
20
|
+
}
|
|
21
|
+
async tick() {
|
|
22
|
+
this.state = tick(this.diagram, this.state);
|
|
23
|
+
return this.state;
|
|
24
|
+
}
|
|
25
|
+
async fire(elementId, variables) {
|
|
26
|
+
this.state = fire(this.diagram, this.state, elementId, variables);
|
|
27
|
+
return this.state;
|
|
28
|
+
}
|
|
29
|
+
async getFireable() {
|
|
30
|
+
return getFireable(this.diagram, this.state);
|
|
31
|
+
}
|
|
32
|
+
getState() {
|
|
33
|
+
return this.state;
|
|
34
|
+
}
|
|
35
|
+
isCompleted() {
|
|
36
|
+
return isCompleted(this.state);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
function createPreviewAdapter(diagram, initialVariables) {
|
|
40
|
+
return new PreviewAdapter(diagram, initialVariables);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { createPreviewAdapter };
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flowable/adapter.ts"],"names":[],"mappings":";;;;;;;;;;AA0EA,IAAM,iBAAN,MAAkD;AAAA,EAIhD,WAAA,CACmB,OAAA,EACjB,gBAAA,GAAiC,EAAC,EAClC;AAFiB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAJnB,IAAA,IAAA,CAAS,IAAA,GAAgB,SAAA;AAOvB,IAAA,IAAA,CAAK,KAAA,GAAQ,gBAAA,CAAiB,OAAA,EAAS,gBAAgB,CAAA;AAAA,EACzD;AAAA,EAEA,MAAM,MAAM,SAAA,EAAoD;AAC9D,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAA,CAAK,IAAA,CAAK,OAAA,EAAS,gBAAA,CAAiB,KAAK,OAAA,EAAS,SAAA,IAAa,EAAE,CAAC,CAAA;AAC/E,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AAAA,EAEA,MAAM,IAAA,GAAiC;AACrC,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAA,CAAK,IAAA,CAAK,OAAA,EAAS,KAAK,KAAK,CAAA;AAC1C,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AAAA,EAEA,MAAM,IAAA,CAAK,SAAA,EAAmB,SAAA,EAAoD;AAChF,IAAA,IAAA,CAAK,QAAQ,IAAA,CAAK,IAAA,CAAK,SAAS,IAAA,CAAK,KAAA,EAAO,WAAW,SAAS,CAAA;AAChE,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AAAA,EAEA,MAAM,WAAA,GAAiC;AACrC,IAAA,OAAO,WAAA,CAAY,IAAA,CAAK,OAAA,EAAS,IAAA,CAAK,KAAK,CAAA;AAAA,EAC7C;AAAA,EAEA,QAAA,GAA4B;AAC1B,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AAAA,EAEA,WAAA,GAAuB;AACrB,IAAA,OAAO,WAAA,CAAY,KAAK,KAAK,CAAA;AAAA,EAC/B;AACF,CAAA;AAIO,SAAS,oBAAA,CACd,SACA,gBAAA,EACmB;AACnB,EAAA,OAAO,IAAI,cAAA,CAAe,OAAA,EAAS,gBAAgB,CAAA;AACrD","file":"index.js","sourcesContent":["import {\n createSimulation,\n tick,\n fire,\n getFireable,\n isCompleted,\n type SimDiagram,\n type SimulationState,\n} from \"../simulation/index\";\n\nexport type SimMode = \"preview\" | \"live\";\n\nexport type SimVariables = Record<string, string | number | boolean>;\n\n// ─── SimulationAdapter ────────────────────────────────────────────────────────\n//\n// Contract between the UI and whatever drives process execution.\n//\n// The webapp implements this interface for \"live\" mode by calling its own\n// backend API (which in turn calls Flowable). The library provides only the\n// \"preview\" implementation for offline design-time simulation.\n//\n// Example live adapter in the webapp:\n//\n// function createBackendAdapter(apiBase: string): SimulationAdapter {\n// let lastState = /* idle SimulationState */;\n// return {\n// mode: \"live\",\n// async start(vars) {\n// lastState = await post(`${apiBase}/process/start`, vars);\n// return lastState;\n// },\n// async tick() {\n// lastState = await get(`${apiBase}/process/state`);\n// return lastState;\n// },\n// async fire(elementId, vars) {\n// lastState = await post(`${apiBase}/process/fire/${elementId}`, vars);\n// return lastState;\n// },\n// async getFireable() {\n// return get(`${apiBase}/process/fireable`);\n// },\n// getState() { return lastState; },\n// isCompleted() { return lastState.status === \"completed\"; },\n// };\n// }\n\nexport interface SimulationAdapter {\n readonly mode: SimMode;\n\n /** Initialize the simulation. Places tokens (preview) or starts the process instance (live). */\n start(variables?: SimVariables): Promise<SimulationState>;\n\n /** Advance automatic elements. No-op in live mode — the engine drives execution. */\n tick(): Promise<SimulationState>;\n\n /**\n * Manually fire an element (complete a task, trigger a catch event).\n * In live mode: delegates to the backend, which completes the Flowable task.\n */\n fire(elementId: string, variables?: SimVariables): Promise<SimulationState>;\n\n /** Returns element IDs that can be manually fired right now. */\n getFireable(): Promise<string[]>;\n\n /** Returns the last known SimulationState snapshot without a network call. */\n getState(): SimulationState;\n\n isCompleted(): boolean;\n}\n\n// ─── Preview adapter — offline, uses the token simulator ─────────────────────\n\nclass PreviewAdapter implements SimulationAdapter {\n readonly mode: SimMode = \"preview\";\n private state: SimulationState;\n\n constructor(\n private readonly diagram: SimDiagram,\n initialVariables: SimVariables = {},\n ) {\n this.state = createSimulation(diagram, initialVariables);\n }\n\n async start(variables?: SimVariables): Promise<SimulationState> {\n this.state = tick(this.diagram, createSimulation(this.diagram, variables ?? {}));\n return this.state;\n }\n\n async tick(): Promise<SimulationState> {\n this.state = tick(this.diagram, this.state);\n return this.state;\n }\n\n async fire(elementId: string, variables?: SimVariables): Promise<SimulationState> {\n this.state = fire(this.diagram, this.state, elementId, variables);\n return this.state;\n }\n\n async getFireable(): Promise<string[]> {\n return getFireable(this.diagram, this.state);\n }\n\n getState(): SimulationState {\n return this.state;\n }\n\n isCompleted(): boolean {\n return isCompleted(this.state);\n }\n}\n\n// ─── Factory ──────────────────────────────────────────────────────────────────\n\nexport function createPreviewAdapter(\n diagram: SimDiagram,\n initialVariables?: SimVariables,\n): SimulationAdapter {\n return new PreviewAdapter(diagram, initialVariables);\n}\n"]}
|