This is an automated email from the ASF dual-hosted git repository.

ricardozanini pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new c2027e17984 Kie tools#3324 [serverless-workflow-diagram-editor] for a 
foreach state the foreach node is not coloured  (#3391)
c2027e17984 is described below

commit c2027e17984f5c111de0ac8b4c4e4be483bac8d1
Author: Kumar Aditya Raj <[email protected]>
AuthorDate: Thu Jan 29 20:25:22 2026 +0530

    Kie tools#3324 [serverless-workflow-diagram-editor] for a foreach state the 
foreach node is not coloured  (#3391)
    
    Co-authored-by: fantonangeli <[email protected]>
    Co-authored-by: kumaradityaraj <[email protected]>
---
 .../runtime-tools-shared-gateway-api/src/types.ts  |   10 +
 .../SwfCombinedEditor/SwfCombinedEditor.tsx        |   18 +-
 .../tests/components/SwfCombinedEditor.test.tsx    |  152 +++
 .../src/graphql/queries.tsx                        |   12 +
 .../src/graphql/types.tsx                          |   12 +
 .../runtime-tools-swf-gateway-api/src/types.ts     |    3 +-
 .../sonataflow-dev-app/src/MockData/graphql.js     | 1007 +++++++++++++++++++-
 packages/sonataflow-dev-app/src/MockData/types.js  |    8 +
 8 files changed, 1189 insertions(+), 33 deletions(-)

diff --git a/packages/runtime-tools-shared-gateway-api/src/types.ts 
b/packages/runtime-tools-shared-gateway-api/src/types.ts
index 86ec09e5886..630a0284d90 100644
--- a/packages/runtime-tools-shared-gateway-api/src/types.ts
+++ b/packages/runtime-tools-shared-gateway-api/src/types.ts
@@ -45,6 +45,16 @@ export interface TriggerableNode {
   type: string;
 }
 
+export interface NodeDefinition extends TriggerableNode {
+  uniqueId: string;
+  metadata?: {
+    UniqueId: string;
+    state: string | null;
+    branch: string | null;
+    action: string | null;
+  };
+}
+
 export interface Milestone {
   __typename?: "Milestone";
   id: string;
diff --git 
a/packages/runtime-tools-swf-enveloped-components/src/workflowDetails/envelope/components/SwfCombinedEditor/SwfCombinedEditor.tsx
 
b/packages/runtime-tools-swf-enveloped-components/src/workflowDetails/envelope/components/SwfCombinedEditor/SwfCombinedEditor.tsx
index 1677f08b446..6a54e1244c7 100644
--- 
a/packages/runtime-tools-swf-enveloped-components/src/workflowDetails/envelope/components/SwfCombinedEditor/SwfCombinedEditor.tsx
+++ 
b/packages/runtime-tools-swf-enveloped-components/src/workflowDetails/envelope/components/SwfCombinedEditor/SwfCombinedEditor.tsx
@@ -41,7 +41,7 @@ import { ServerlessWorkflowCombinedEditorEnvelopeApi } from 
"@kie-tools/serverle
 import { WorkflowInstance } from 
"@kie-tools/runtime-tools-swf-gateway-api/dist/types";
 
 interface ISwfCombinedEditorProps {
-  workflowInstance: Pick<WorkflowInstance, "source" | "nodes" | "error">;
+  workflowInstance: Pick<WorkflowInstance, "source" | "nodes" | "error" | 
"nodeDefinitions">;
   width?: number;
   height?: number;
 }
@@ -53,7 +53,7 @@ const SwfCombinedEditor: React.FC<ISwfCombinedEditorProps & 
OUIAProps> = ({
   ouiaId,
   ouiaSafe,
 }) => {
-  const { source, nodes, error } = workflowInstance;
+  const { source, nodes, error, nodeDefinitions } = workflowInstance;
   const [editor, editorRef] = useController<EmbeddedEditorRef>();
   const [isReady, setReady] = useState<boolean>(false);
 
@@ -138,6 +138,13 @@ const SwfCombinedEditor: React.FC<ISwfCombinedEditorProps 
& OUIAProps> = ({
     [channelApiImpl, swfPreviewOptionsChannelApiImpl]
   );
 
+  const nodeDefinitionsMap = useMemo(() => {
+    if (!nodeDefinitions) {
+      return new Map();
+    }
+    return new Map(nodeDefinitions.map((def) => [def.id, def]));
+  }, [nodeDefinitions]);
+
   useEffect(() => {
     const combinedEditorChannelApi = embeddedFile
       ? (editor?.getEnvelopeServer()
@@ -152,6 +159,11 @@ const SwfCombinedEditor: React.FC<ISwfCombinedEditorProps 
& OUIAProps> = ({
 
     nodes.forEach((node) => {
       nodeNames.push(node.name);
+      const nodeDefinition = nodeDefinitionsMap.get(node.definitionId);
+      const stateName = nodeDefinition?.metadata?.state;
+      if (stateName) {
+        nodeNames.push(stateName);
+      }
     });
 
     const colorConnectedEnds = nodeNames.includes("End");
@@ -181,7 +193,7 @@ const SwfCombinedEditor: React.FC<ISwfCombinedEditorProps & 
OUIAProps> = ({
         });
       });
     }
-  }, [editor, nodes, embeddedFile]);
+  }, [editor, nodes, embeddedFile, nodeDefinitionsMap, error]);
 
   return (
     <Card style={{ height: height, width: width }} 
{...componentOuiaProps(ouiaId, "swf-diagram", ouiaSafe)}>
diff --git 
a/packages/runtime-tools-swf-enveloped-components/tests/components/SwfCombinedEditor.test.tsx
 
b/packages/runtime-tools-swf-enveloped-components/tests/components/SwfCombinedEditor.test.tsx
new file mode 100644
index 00000000000..92eac1dd45e
--- /dev/null
+++ 
b/packages/runtime-tools-swf-enveloped-components/tests/components/SwfCombinedEditor.test.tsx
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import * as React from "react";
+import { render, waitFor } from "@testing-library/react";
+import "@testing-library/jest-dom";
+import SwfCombinedEditor from 
"@kie-tools/runtime-tools-swf-enveloped-components/dist/workflowDetails/envelope/components/SwfCombinedEditor/SwfCombinedEditor";
+import { WorkflowInstance, WorkflowInstanceState } from 
"@kie-tools/runtime-tools-swf-gateway-api/dist/types";
+
+global.TextDecoder = require("util").TextDecoder;
+
+// Mock for envelope API
+const mockColorNodesSend = jest.fn();
+const mockSubscribe = jest.fn((callback) => {
+  callback();
+  return { unsubscribe: jest.fn() };
+});
+
+const mockEnvelopeAndChannelApi = {
+  notifications: {
+    kogitoSwfCombinedEditor_colorNodes: {
+      send: mockColorNodesSend,
+    },
+    kogitoSwfCombinedEditor_combinedEditorReady: {
+      subscribe: mockSubscribe,
+    },
+  },
+};
+
+// Mock useController to provide a mock editor with envelope API
+jest.mock("@kie-tools/runtime-tools-swf-enveloped-components/dist/workflowDetails/hooks/useController",
 () => ({
+  useController: jest.fn(() => [
+    {
+      getEnvelopeServer: () => ({
+        envelopeApi: mockEnvelopeAndChannelApi,
+      }),
+    },
+    jest.fn(),
+  ]),
+}));
+
+describe("SwfCombinedEditor - ForEach node coloring", () => {
+  beforeEach(() => {
+    jest.clearAllMocks();
+    mockColorNodesSend.mockClear();
+  });
+
+  it("should color ForEach nodes using nodeDefinitions metadata", async () => {
+    const workflowInstance: WorkflowInstance = {
+      id: "c55b6474-d83b-47c5-ac32-bf12c9adc9e1",
+      processId: "foreach",
+      state: WorkflowInstanceState.Completed,
+      endpoint: "http://localhost:4000/foreach";,
+      nodes: [
+        {
+          id: "1",
+          nodeId: "1",
+          name: "Start",
+          definitionId: "1",
+          type: "StartNode",
+          enter: new Date("2024-10-18T12:25:00.192Z"),
+        },
+        {
+          id: "2",
+          nodeId: "2",
+          name: "ForEach",
+          definitionId: "3",
+          type: "ForEachNode",
+          enter: new Date("2024-10-18T12:25:00.192Z"),
+        },
+        {
+          id: "3",
+          nodeId: "3",
+          name: "End",
+          definitionId: "2",
+          type: "EndNode",
+          enter: new Date("2024-10-18T12:26:00.192Z"),
+        },
+      ],
+      start: new Date("2024-10-18T12:25:00.192Z"),
+      lastUpdate: new Date("2024-10-18T12:25:00.192Z"),
+      source:
+        "id: foreach\nversion: '1.0'\nspecVersion: '0.8.0'\nname: 
foreach\nstart: ForEachState\nstates:\n- name: ForEachState\n  type: foreach\n  
end: true\n",
+      nodeDefinitions: [
+        {
+          id: "1",
+          name: "Start",
+          type: "StartNode",
+          uniqueId: "1",
+          metadata: {
+            UniqueId: "1",
+            state: "ForEachState",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "2",
+          name: "End",
+          type: "EndNode",
+          uniqueId: "2",
+          metadata: {
+            UniqueId: "2",
+            state: "ForEachState",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "3",
+          name: "ForEach",
+          type: "ForEachNode",
+          uniqueId: "3",
+          metadata: {
+            UniqueId: "3",
+            state: "ForEachState",
+            branch: null,
+            action: null,
+          },
+        },
+      ],
+    };
+
+    render(<SwfCombinedEditor workflowInstance={workflowInstance} />);
+
+    await waitFor(() => {
+      expect(mockColorNodesSend).toHaveBeenCalled();
+    });
+
+    const callArgs = mockColorNodesSend.mock.calls[0][0];
+    expect(callArgs.nodeNames).toContain("Start");
+    expect(callArgs.nodeNames).toContain("ForEach");
+    expect(callArgs.nodeNames).toContain("ForEachState");
+    expect(callArgs.nodeNames).toContain("End");
+  });
+});
diff --git a/packages/runtime-tools-swf-gateway-api/src/graphql/queries.tsx 
b/packages/runtime-tools-swf-gateway-api/src/graphql/queries.tsx
index cae532f1b52..a902b636fbf 100644
--- a/packages/runtime-tools-swf-gateway-api/src/graphql/queries.tsx
+++ b/packages/runtime-tools-swf-gateway-api/src/graphql/queries.tsx
@@ -112,6 +112,18 @@ export const GET_PROCESS_INSTANCE = gql`
         type
         definitionId
       }
+      nodeDefinitions {
+        id
+        name
+        type
+        uniqueId
+        metadata {
+          UniqueId
+          state
+          branch
+          action
+        }
+      }
       milestones {
         id
         name
diff --git a/packages/runtime-tools-swf-gateway-api/src/graphql/types.tsx 
b/packages/runtime-tools-swf-gateway-api/src/graphql/types.tsx
index a3395882cbd..d1287b3c497 100644
--- a/packages/runtime-tools-swf-gateway-api/src/graphql/types.tsx
+++ b/packages/runtime-tools-swf-gateway-api/src/graphql/types.tsx
@@ -1611,6 +1611,18 @@ export namespace GraphQL {
           type
           definitionId
         }
+        nodeDefinitions {
+          id
+          name
+          type
+          uniqueId
+          metadata {
+            UniqueId
+            state
+            branch
+            action
+          }
+        }
         milestones {
           id
           name
diff --git a/packages/runtime-tools-swf-gateway-api/src/types.ts 
b/packages/runtime-tools-swf-gateway-api/src/types.ts
index 32fa6b87a69..f9ba7e03bdf 100644
--- a/packages/runtime-tools-swf-gateway-api/src/types.ts
+++ b/packages/runtime-tools-swf-gateway-api/src/types.ts
@@ -21,6 +21,7 @@ import {
   NodeInstance,
   Milestone,
   TriggerableNode,
+  NodeDefinition,
   OrderBy,
   JsonType,
 } from "@kie-tools/runtime-tools-shared-gateway-api/dist/types";
@@ -116,7 +117,7 @@ export interface WorkflowInstance {
   errorMessage?: string;
   isOpen?: boolean;
   diagram?: string;
-  nodeDefinitions?: TriggerableNode[];
+  nodeDefinitions?: NodeDefinition[];
   source?: string;
 }
 
diff --git a/packages/sonataflow-dev-app/src/MockData/graphql.js 
b/packages/sonataflow-dev-app/src/MockData/graphql.js
index 226ae19526a..1d7f33249c1 100644
--- a/packages/sonataflow-dev-app/src/MockData/graphql.js
+++ b/packages/sonataflow-dev-app/src/MockData/graphql.js
@@ -180,6 +180,539 @@ module.exports = {
           __typename: "NodeInstance",
         },
       ],
+      nodeDefinitions: [
+        {
+          id: "1",
+          name: "Start",
+          type: "StartNode",
+          uniqueId: "1",
+          metadata: {
+            UniqueId: "1",
+            state: "PrintStartMessage",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "10",
+          name: "EmbeddedStart",
+          type: "StartNode",
+          uniqueId: "10",
+          metadata: {
+            UniqueId: "10",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "12",
+          name: "systemOut",
+          type: "ActionNode",
+          uniqueId: "12",
+          metadata: {
+            UniqueId: "12",
+            state: "CallbackState",
+            branch: null,
+            action: "callbackAction",
+          },
+        },
+        {
+          id: "13",
+          name: "Script",
+          type: "ActionNode",
+          uniqueId: "13",
+          metadata: {
+            UniqueId: "13",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "15",
+          name: "callbackEvent",
+          type: "EventNode",
+          uniqueId: "15",
+          metadata: {
+            UniqueId: "15",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "16",
+          name: "Script",
+          type: "ActionNode",
+          uniqueId: "16",
+          metadata: {
+            UniqueId: "16",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "17",
+          name: "EventSplit_17",
+          type: "Split",
+          uniqueId: "17",
+          metadata: {
+            UniqueId: "17",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "18",
+          name: "ExclusiveJoin_18",
+          type: "Join",
+          uniqueId: "18",
+          metadata: {
+            UniqueId: "18",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "19",
+          name: "TimerNode_19",
+          type: "TimerNode",
+          uniqueId: "19",
+          metadata: {
+            UniqueId: "19",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "2",
+          name: "End",
+          type: "EndNode",
+          uniqueId: "2",
+          metadata: {
+            UniqueId: "2",
+            state: "PrintExitMessage",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "20",
+          name: "EmbeddedEnd",
+          type: "EndNode",
+          uniqueId: "20",
+          metadata: {
+            UniqueId: "20",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "21",
+          name: "CheckEventArrival",
+          type: "Split",
+          uniqueId: "21",
+          metadata: {
+            UniqueId: "21",
+            state: "CheckEventArrival",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "22",
+          name: "EventArrived",
+          type: "ActionNode",
+          uniqueId: "22",
+          metadata: {
+            UniqueId: "22",
+            state: "EventArrived",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "23",
+          name: "EventNotArrived",
+          type: "ActionNode",
+          uniqueId: "23",
+          metadata: {
+            UniqueId: "23",
+            state: "EventNotArrived",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "24",
+          name: "PrintExitMessage",
+          type: "CompositeContextNode",
+          uniqueId: "24",
+          metadata: {
+            UniqueId: "24",
+            state: "PrintExitMessage",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "25",
+          name: "EmbeddedStart",
+          type: "StartNode",
+          uniqueId: "25",
+          metadata: {
+            UniqueId: "25",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "27",
+          name: "systemOut",
+          type: "ActionNode",
+          uniqueId: "27",
+          metadata: {
+            UniqueId: "27",
+            state: "PrintExitMessage",
+            branch: null,
+            action: "printSystemOut",
+          },
+        },
+        {
+          id: "28",
+          name: "Script",
+          type: "ActionNode",
+          uniqueId: "28",
+          metadata: {
+            UniqueId: "28",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "29",
+          name: "EmbeddedEnd",
+          type: "EndNode",
+          uniqueId: "29",
+          metadata: {
+            UniqueId: "29",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "3",
+          name: "PrintStartMessage",
+          type: "CompositeContextNode",
+          uniqueId: "3",
+          metadata: {
+            UniqueId: "3",
+            state: "PrintStartMessage",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "30",
+          name: "Join-PrintExitMessage",
+          type: "Join",
+          uniqueId: "30",
+          metadata: {
+            UniqueId: "30",
+            state: "PrintExitMessage",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "4",
+          name: "EmbeddedStart",
+          type: "StartNode",
+          uniqueId: "4",
+          metadata: {
+            UniqueId: "4",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "6",
+          name: "systemOut",
+          type: "ActionNode",
+          uniqueId: "6",
+          metadata: {
+            UniqueId: "6",
+            state: "PrintStartMessage",
+            branch: null,
+            action: "printSystemOut",
+          },
+        },
+        {
+          id: "7",
+          name: "Script",
+          type: "ActionNode",
+          uniqueId: "7",
+          metadata: {
+            UniqueId: "7",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "8",
+          name: "EmbeddedEnd",
+          type: "EndNode",
+          uniqueId: "8",
+          metadata: {
+            UniqueId: "8",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "9",
+          name: "CallbackState",
+          type: "CompositeContextNode",
+          uniqueId: "9",
+          metadata: {
+            UniqueId: "9",
+            state: "CallbackState",
+            branch: null,
+            action: null,
+          },
+        },
+      ],
+      milestones: [],
+      __typename: "ProcessInstance",
+    },
+    {
+      id: "f4a7914a-15e5-4cf1-aee2-3109af3ad8c0",
+      processId: "foreach",
+      processName: "foreach",
+      businessKey: null,
+      parentProcessInstanceId: null,
+      parentProcessInstance: null,
+      roles: [],
+      variables: null,
+      state: "COMPLETED",
+      start: "2025-12-10T10:25:36.937Z",
+      lastUpdate: "2025-12-10T10:25:36.97Z",
+      end: "2025-12-10T10:25:36.97Z",
+      addons: ["process-management", "source-files", "cloudevents", 
"knative-eventing", "jobs-management"],
+      endpoint: "http://localhost:4000/foreach";,
+      serviceUrl: "http://localhost:4000";,
+      source:
+        "id: foreach\nversion: '1.0'\nspecVersion: '0.8.0'\nname: 
foreach\ndescription: foreach flow\nfunctions:\n- name: printMessage\n  type: 
custom\n  operation: sysout\nstart: ForEachState\nstates:\n- name: 
ForEachState\n  type: foreach\n  inputCollection: '[1,2,3]'\n  iterationParam: 
item\n  actions:\n  - functionRef:\n      refName: printMessage\n      
arguments:\n        message: '\"item: \" + .item +\"!\"'\n  batchSize: 1\n  
end: true",
+      error: null,
+      childProcessInstances: [],
+      nodes: [
+        {
+          id: "e5397466-0c7c-46f3-b641-302f60486396",
+          nodeId: "1",
+          name: "Start",
+          enter: "2025-12-10T10:25:36.938Z",
+          exit: "2025-12-10T10:25:36.971Z",
+          type: "StartNode",
+          definitionId: "1",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "a5eb17af-81ac-488f-9874-4300a5f81e31",
+          nodeId: "3",
+          name: "ForEach",
+          enter: "2025-12-10T10:25:36.94Z",
+          exit: "2025-12-10T10:25:36.971Z",
+          type: "ForEachNode",
+          definitionId: "3",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "bee7381c-804b-4f98-b36f-28b41e3b9483",
+          nodeId: "4",
+          name: "EmbeddedStart",
+          enter: "2025-12-10T10:25:36.944Z",
+          exit: "2025-12-10T10:25:36.964Z",
+          type: "StartNode",
+          definitionId: "4",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "b6e512bd-0257-489b-b303-731f235012a3",
+          nodeId: "5",
+          name: "printMessage",
+          enter: "2025-12-10T10:25:36.944Z",
+          exit: "2025-12-10T10:25:36.964Z",
+          type: "ActionNode",
+          definitionId: "5",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "d457cd37-033f-48c9-880a-78d756a015dd",
+          nodeId: "6",
+          name: "EmbeddedEnd",
+          enter: "2025-12-10T10:25:36.962Z",
+          exit: "2025-12-10T10:25:36.964Z",
+          type: "EndNode",
+          definitionId: "6",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "57b6f38b-29b2-4207-a6c0-e505d4def511",
+          nodeId: "4",
+          name: "EmbeddedStart",
+          enter: "2025-12-10T10:25:36.965Z",
+          exit: "2025-12-10T10:25:36.966Z",
+          type: "StartNode",
+          definitionId: "4",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "fa2f214b-11a7-4492-ac31-f4e9b66c1a5b",
+          nodeId: "5",
+          name: "printMessage",
+          enter: "2025-12-10T10:25:36.965Z",
+          exit: "2025-12-10T10:25:36.966Z",
+          type: "ActionNode",
+          definitionId: "5",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "6ccdddc5-e4ce-40d3-a0f5-44bcc0bb6a72",
+          nodeId: "6",
+          name: "EmbeddedEnd",
+          enter: "2025-12-10T10:25:36.966Z",
+          exit: "2025-12-10T10:25:36.966Z",
+          type: "EndNode",
+          definitionId: "6",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "ac8044f3-3db5-4e0b-a01e-95914463f558",
+          nodeId: "4",
+          name: "EmbeddedStart",
+          enter: "2025-12-10T10:25:36.967Z",
+          exit: "2025-12-10T10:25:36.971Z",
+          type: "StartNode",
+          definitionId: "4",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "15d76e9b-b4e2-4b59-9baf-c3ce04550cff",
+          nodeId: "5",
+          name: "printMessage",
+          enter: "2025-12-10T10:25:36.967Z",
+          exit: "2025-12-10T10:25:36.971Z",
+          type: "ActionNode",
+          definitionId: "5",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "deb454e0-5854-4a74-9c19-dbed171b6d92",
+          nodeId: "6",
+          name: "EmbeddedEnd",
+          enter: "2025-12-10T10:25:36.968Z",
+          exit: "2025-12-10T10:25:36.971Z",
+          type: "EndNode",
+          definitionId: "6",
+          __typename: "NodeInstance",
+        },
+        {
+          id: "877370ec-59f2-4e47-a7b2-056359dca8c3",
+          nodeId: "2",
+          name: "End",
+          enter: "2025-12-10T10:25:36.968Z",
+          exit: "2025-12-10T10:25:36.971Z",
+          type: "EndNode",
+          definitionId: "2",
+          __typename: "NodeInstance",
+        },
+      ],
+      nodeDefinitions: [
+        {
+          id: "1",
+          name: "Start",
+          type: "StartNode",
+          uniqueId: "1",
+          metadata: {
+            UniqueId: "1",
+            state: "ForEachState",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "2",
+          name: "End",
+          type: "EndNode",
+          uniqueId: "2",
+          metadata: {
+            UniqueId: "2",
+            state: "ForEachState",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "3",
+          name: "ForEach",
+          type: "ForEachNode",
+          uniqueId: "3",
+          metadata: {
+            UniqueId: "3",
+            state: "ForEachState",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "4",
+          name: "EmbeddedStart",
+          type: "StartNode",
+          uniqueId: "4",
+          metadata: {
+            UniqueId: "4",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "5",
+          name: "printMessage",
+          type: "ActionNode",
+          uniqueId: "5",
+          metadata: {
+            UniqueId: "5",
+            state: "ForEachState",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "6",
+          name: "EmbeddedEnd",
+          type: "EndNode",
+          uniqueId: "6",
+          metadata: {
+            UniqueId: "6",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+      ],
       milestones: [],
       __typename: "ProcessInstance",
     },
@@ -216,7 +749,7 @@ module.exports = {
           enter: "2024-05-30T11:09:26.858Z",
           exit: "2024-05-30T11:09:26.858Z",
           type: "EndNode",
-          definitionId: "_jbpm-unique-28",
+          definitionId: "2",
           __typename: "NodeInstance",
         },
         {
@@ -226,7 +759,7 @@ module.exports = {
           enter: "2024-05-30T11:09:06.135Z",
           exit: "2024-05-30T11:09:26.857Z",
           type: "CompositeContextNode",
-          definitionId: "_jbpm-unique-29",
+          definitionId: "3",
           __typename: "NodeInstance",
         },
         {
@@ -236,7 +769,7 @@ module.exports = {
           enter: "2024-05-30T11:09:26.857Z",
           exit: "2024-05-30T11:09:26.857Z",
           type: "EndNode",
-          definitionId: "_jbpm-unique-33",
+          definitionId: "8",
           __typename: "NodeInstance",
         },
         {
@@ -246,7 +779,7 @@ module.exports = {
           enter: "2024-05-30T11:09:26.857Z",
           exit: "2024-05-30T11:09:26.857Z",
           type: "ActionNode",
-          definitionId: "_jbpm-unique-32",
+          definitionId: "7",
           __typename: "NodeInstance",
         },
         {
@@ -256,7 +789,7 @@ module.exports = {
           enter: "2024-05-30T11:09:06.137Z",
           exit: "2024-05-30T11:09:26.857Z",
           type: "WorkItemNode",
-          definitionId: "_jbpm-unique-31",
+          definitionId: "6",
           __typename: "NodeInstance",
         },
         {
@@ -266,7 +799,7 @@ module.exports = {
           enter: "2024-05-30T11:09:06.136Z",
           exit: "2024-05-30T11:09:06.136Z",
           type: "StartNode",
-          definitionId: "_jbpm-unique-30",
+          definitionId: "4",
           __typename: "NodeInstance",
         },
         {
@@ -276,10 +809,96 @@ module.exports = {
           enter: "2024-05-30T11:09:06.134Z",
           exit: "2024-05-30T11:09:06.134Z",
           type: "StartNode",
-          definitionId: "_jbpm-unique-27",
+          definitionId: "1",
           __typename: "NodeInstance",
         },
       ],
+      nodeDefinitions: [
+        {
+          id: "1",
+          name: "Start",
+          type: "StartNode",
+          uniqueId: "1",
+          metadata: {
+            UniqueId: "1",
+            state: "Service",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "2",
+          name: "End",
+          type: "EndNode",
+          uniqueId: "2",
+          metadata: {
+            UniqueId: "2",
+            state: "Service",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "3",
+          name: "Service",
+          type: "CompositeContextNode",
+          uniqueId: "3",
+          metadata: {
+            UniqueId: "3",
+            state: "Service",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "4",
+          name: "EmbeddedStart",
+          type: "StartNode",
+          uniqueId: "4",
+          metadata: {
+            UniqueId: "4",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "6",
+          name: "isWinner",
+          type: "WorkItemNode",
+          uniqueId: "6",
+          metadata: {
+            UniqueId: "6",
+            state: "Service",
+            branch: null,
+            action: "CallService",
+          },
+        },
+        {
+          id: "7",
+          name: "Script",
+          type: "ActionNode",
+          uniqueId: "7",
+          metadata: {
+            UniqueId: "7",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "8",
+          name: "EmbeddedEnd",
+          type: "EndNode",
+          uniqueId: "8",
+          metadata: {
+            UniqueId: "8",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+      ],
       milestones: [],
       __typename: "ProcessInstance",
     },
@@ -317,7 +936,7 @@ module.exports = {
           enter: "2024-05-30T11:08:49.531Z",
           exit: "2024-05-30T11:08:49.531Z",
           type: "EndNode",
-          definitionId: "_jbpm-unique-13",
+          definitionId: "2",
           __typename: "NodeInstance",
         },
         {
@@ -327,7 +946,7 @@ module.exports = {
           enter: "2024-05-30T11:08:49.529Z",
           exit: "2024-05-30T11:08:49.531Z",
           type: "CompositeContextNode",
-          definitionId: "_jbpm-unique-17",
+          definitionId: "6",
           __typename: "NodeInstance",
         },
         {
@@ -337,7 +956,7 @@ module.exports = {
           enter: "2024-05-30T11:08:49.531Z",
           exit: "2024-05-30T11:08:49.531Z",
           type: "EndNode",
-          definitionId: "_jbpm-unique-21",
+          definitionId: "11",
           __typename: "NodeInstance",
         },
         {
@@ -347,7 +966,7 @@ module.exports = {
           enter: "2024-05-30T11:08:49.53Z",
           exit: "2024-05-30T11:08:49.53Z",
           type: "ActionNode",
-          definitionId: "_jbpm-unique-20",
+          definitionId: "10",
           __typename: "NodeInstance",
         },
         {
@@ -357,7 +976,7 @@ module.exports = {
           enter: "2024-05-30T11:08:49.53Z",
           exit: "2024-05-30T11:08:49.53Z",
           type: "ActionNode",
-          definitionId: "_jbpm-unique-19",
+          definitionId: "9",
           __typename: "NodeInstance",
         },
         {
@@ -367,7 +986,7 @@ module.exports = {
           enter: "2024-05-30T11:08:49.529Z",
           exit: "2024-05-30T11:08:49.529Z",
           type: "StartNode",
-          definitionId: "_jbpm-unique-18",
+          definitionId: "7",
           __typename: "NodeInstance",
         },
         {
@@ -377,7 +996,7 @@ module.exports = {
           enter: "2024-05-30T11:08:49.529Z",
           exit: "2024-05-30T11:08:49.529Z",
           type: "Join",
-          definitionId: "_jbpm-unique-23",
+          definitionId: "13",
           __typename: "NodeInstance",
         },
         {
@@ -387,7 +1006,7 @@ module.exports = {
           enter: "2024-05-30T11:08:49.528Z",
           exit: "2024-05-30T11:08:49.528Z",
           type: "ActionNode",
-          definitionId: "_jbpm-unique-15",
+          definitionId: "4",
           __typename: "NodeInstance",
         },
         {
@@ -397,7 +1016,7 @@ module.exports = {
           enter: "2024-05-30T11:08:49.527Z",
           exit: "2024-05-30T11:08:49.527Z",
           type: "Join",
-          definitionId: "_jbpm-unique-22",
+          definitionId: "12",
           __typename: "NodeInstance",
         },
         {
@@ -417,10 +1036,156 @@ module.exports = {
           enter: "2024-05-30T11:08:49.509Z",
           exit: "2024-05-30T11:08:49.51Z",
           type: "StartNode",
-          definitionId: "_jbpm-unique-12",
+          definitionId: "1",
           __typename: "NodeInstance",
         },
       ],
+      nodeDefinitions: [
+        {
+          id: "1",
+          name: "Start",
+          type: "StartNode",
+          uniqueId: "1",
+          metadata: {
+            UniqueId: "1",
+            state: "ChooseOnLanguage",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "10",
+          name: "Script",
+          type: "ActionNode",
+          uniqueId: "10",
+          metadata: {
+            UniqueId: "10",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "11",
+          name: "EmbeddedEnd",
+          type: "EndNode",
+          uniqueId: "11",
+          metadata: {
+            UniqueId: "11",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "12",
+          name: "Join-GreetInEnglish",
+          type: "Join",
+          uniqueId: "12",
+          metadata: {
+            UniqueId: "12",
+            state: "GreetInEnglish",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "13",
+          name: "Join-GreetPerson",
+          type: "Join",
+          uniqueId: "13",
+          metadata: {
+            UniqueId: "13",
+            state: "GreetPerson",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "2",
+          name: "End",
+          type: "EndNode",
+          uniqueId: "2",
+          metadata: {
+            UniqueId: "2",
+            state: "GreetPerson",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "3",
+          name: "ChooseOnLanguage",
+          type: "Split",
+          uniqueId: "3",
+          metadata: {
+            UniqueId: "3",
+            state: "ChooseOnLanguage",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "4",
+          name: "GreetInEnglish",
+          type: "ActionNode",
+          uniqueId: "4",
+          metadata: {
+            UniqueId: "4",
+            state: "GreetInEnglish",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "5",
+          name: "GreetInSpanish",
+          type: "ActionNode",
+          uniqueId: "5",
+          metadata: {
+            UniqueId: "5",
+            state: "GreetInSpanish",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "6",
+          name: "GreetPerson",
+          type: "CompositeContextNode",
+          uniqueId: "6",
+          metadata: {
+            UniqueId: "6",
+            state: "GreetPerson",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "7",
+          name: "EmbeddedStart",
+          type: "StartNode",
+          uniqueId: "7",
+          metadata: {
+            UniqueId: "7",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "9",
+          name: "greetFunction",
+          type: "ActionNode",
+          uniqueId: "9",
+          metadata: {
+            UniqueId: "9",
+            state: "GreetPerson",
+            branch: null,
+            action: "greetAction",
+          },
+        },
+      ],
       milestones: [],
       __typename: "ProcessInstance",
     },
@@ -458,7 +1223,7 @@ module.exports = {
           enter: "2024-05-30T11:08:23.353Z",
           exit: "2024-05-30T11:08:23.353Z",
           type: "EndNode",
-          definitionId: "_jbpm-unique-1",
+          definitionId: "2",
           __typename: "NodeInstance",
         },
         {
@@ -468,7 +1233,7 @@ module.exports = {
           enter: "2024-05-30T11:08:23.351Z",
           exit: "2024-05-30T11:08:23.352Z",
           type: "CompositeContextNode",
-          definitionId: "_jbpm-unique-5",
+          definitionId: "6",
           __typename: "NodeInstance",
         },
         {
@@ -478,7 +1243,7 @@ module.exports = {
           enter: "2024-05-30T11:08:23.352Z",
           exit: "2024-05-30T11:08:23.352Z",
           type: "EndNode",
-          definitionId: "_jbpm-unique-9",
+          definitionId: "11",
           __typename: "NodeInstance",
         },
         {
@@ -488,7 +1253,7 @@ module.exports = {
           enter: "2024-05-30T11:08:23.352Z",
           exit: "2024-05-30T11:08:23.352Z",
           type: "ActionNode",
-          definitionId: "_jbpm-unique-8",
+          definitionId: "10",
           __typename: "NodeInstance",
         },
         {
@@ -498,7 +1263,7 @@ module.exports = {
           enter: "2024-05-30T11:08:23.352Z",
           exit: "2024-05-30T11:08:23.352Z",
           type: "ActionNode",
-          definitionId: "_jbpm-unique-7",
+          definitionId: "9",
           __typename: "NodeInstance",
         },
         {
@@ -508,7 +1273,7 @@ module.exports = {
           enter: "2024-05-30T11:08:23.352Z",
           exit: "2024-05-30T11:08:23.352Z",
           type: "StartNode",
-          definitionId: "_jbpm-unique-6",
+          definitionId: "7",
           __typename: "NodeInstance",
         },
         {
@@ -518,7 +1283,7 @@ module.exports = {
           enter: "2024-05-30T11:08:23.351Z",
           exit: "2024-05-30T11:08:23.351Z",
           type: "Join",
-          definitionId: "_jbpm-unique-11",
+          definitionId: "13",
           __typename: "NodeInstance",
         },
         {
@@ -528,7 +1293,7 @@ module.exports = {
           enter: "2024-05-30T11:08:23.349Z",
           exit: "2024-05-30T11:08:23.351Z",
           type: "ActionNode",
-          definitionId: "_jbpm-unique-4",
+          definitionId: "5",
           __typename: "NodeInstance",
         },
         {
@@ -548,10 +1313,156 @@ module.exports = {
           enter: "2024-05-30T11:08:23.349Z",
           exit: "2024-05-30T11:08:23.349Z",
           type: "StartNode",
-          definitionId: "_jbpm-unique-0",
+          definitionId: "1",
           __typename: "NodeInstance",
         },
       ],
+      nodeDefinitions: [
+        {
+          id: "1",
+          name: "Start",
+          type: "StartNode",
+          uniqueId: "1",
+          metadata: {
+            UniqueId: "1",
+            state: "ChooseOnLanguage",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "10",
+          name: "Script",
+          type: "ActionNode",
+          uniqueId: "10",
+          metadata: {
+            UniqueId: "10",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "11",
+          name: "EmbeddedEnd",
+          type: "EndNode",
+          uniqueId: "11",
+          metadata: {
+            UniqueId: "11",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "12",
+          name: "Join-GreetInEnglish",
+          type: "Join",
+          uniqueId: "12",
+          metadata: {
+            UniqueId: "12",
+            state: "GreetInEnglish",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "13",
+          name: "Join-GreetPerson",
+          type: "Join",
+          uniqueId: "13",
+          metadata: {
+            UniqueId: "13",
+            state: "GreetPerson",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "2",
+          name: "End",
+          type: "EndNode",
+          uniqueId: "2",
+          metadata: {
+            UniqueId: "2",
+            state: "GreetPerson",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "3",
+          name: "ChooseOnLanguage",
+          type: "Split",
+          uniqueId: "3",
+          metadata: {
+            UniqueId: "3",
+            state: "ChooseOnLanguage",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "4",
+          name: "GreetInEnglish",
+          type: "ActionNode",
+          uniqueId: "4",
+          metadata: {
+            UniqueId: "4",
+            state: "GreetInEnglish",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "5",
+          name: "GreetInSpanish",
+          type: "ActionNode",
+          uniqueId: "5",
+          metadata: {
+            UniqueId: "5",
+            state: "GreetInSpanish",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "6",
+          name: "GreetPerson",
+          type: "CompositeContextNode",
+          uniqueId: "6",
+          metadata: {
+            UniqueId: "6",
+            state: "GreetPerson",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "7",
+          name: "EmbeddedStart",
+          type: "StartNode",
+          uniqueId: "7",
+          metadata: {
+            UniqueId: "7",
+            state: null,
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "9",
+          name: "greetFunction",
+          type: "ActionNode",
+          uniqueId: "9",
+          metadata: {
+            UniqueId: "9",
+            state: "GreetPerson",
+            branch: null,
+            action: "greetAction",
+          },
+        },
+      ],
       milestones: [],
       __typename: "ProcessInstance",
     },
@@ -587,7 +1498,7 @@ module.exports = {
           enter: "2024-05-30T11:07:57.538Z",
           exit: "2024-05-30T11:07:57.538Z",
           type: "EndNode",
-          definitionId: "_jbpm-unique-25",
+          definitionId: "2",
           __typename: "NodeInstance",
         },
         {
@@ -597,7 +1508,7 @@ module.exports = {
           enter: "2024-05-30T11:07:57.537Z",
           exit: "2024-05-30T11:07:57.538Z",
           type: "ActionNode",
-          definitionId: "_jbpm-unique-26",
+          definitionId: "3",
           __typename: "NodeInstance",
         },
         {
@@ -607,10 +1518,48 @@ module.exports = {
           enter: "2024-05-30T11:07:57.536Z",
           exit: "2024-05-30T11:07:57.537Z",
           type: "StartNode",
-          definitionId: "_jbpm-unique-24",
+          definitionId: "1",
           __typename: "NodeInstance",
         },
       ],
+      nodeDefinitions: [
+        {
+          id: "1",
+          name: "Start",
+          type: "StartNode",
+          uniqueId: "1",
+          metadata: {
+            UniqueId: "1",
+            state: "HelloWorld",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "2",
+          name: "End",
+          type: "EndNode",
+          uniqueId: "2",
+          metadata: {
+            UniqueId: "2",
+            state: "HelloWorld",
+            branch: null,
+            action: null,
+          },
+        },
+        {
+          id: "3",
+          name: "HelloWorld",
+          type: "ActionNode",
+          uniqueId: "3",
+          metadata: {
+            UniqueId: "3",
+            state: "HelloWorld",
+            branch: null,
+            action: null,
+          },
+        },
+      ],
       milestones: [],
       __typename: "ProcessInstance",
     },
diff --git a/packages/sonataflow-dev-app/src/MockData/types.js 
b/packages/sonataflow-dev-app/src/MockData/types.js
index eaa22f959dd..6860e345897 100644
--- a/packages/sonataflow-dev-app/src/MockData/types.js
+++ b/packages/sonataflow-dev-app/src/MockData/types.js
@@ -103,6 +103,14 @@ module.exports = typeDefs = gql`
     name: String!
     type: String!
     uniqueId: String!
+    metadata: NodeMetadata
+  }
+
+  type NodeMetadata {
+    UniqueId: String!
+    state: String
+    branch: String
+    action: String
   }
 
   type Milestones {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to