Skip to Content
DocsClientsTypeScriptFlowNode-Instanzen

FlowNode-Instanzen

FlowNode-Instanzen repräsentieren die einzelnen Ausführungsschritte innerhalb einer Prozess-Instanz. Diese Seite zeigt, wie Sie die Ausführungshistorie eines Prozesses abrufen.

Grundlegendes Beispiel

import { Client } from '@processcube/client'; const client = new Client('http://localhost:8000'); async function queryFlowNodes() { const processInstanceId = 'instance-123'; const flowNodes = await client.getFlowNodeInstances({ processInstanceId, state: 'finished', }); flowNodes.forEach((flowNode) => { console.log(`FlowNode: ${flowNode.flowNodeId}`); console.log(`Typ: ${flowNode.flowNodeType}`); console.log(`Status: ${flowNode.state}`); }); } queryFlowNodes().catch(console.error);

FlowNode-Typen

FlowNodes entsprechen BPMN-Elementen:

  • startEvent - Start-Event
  • endEvent - End-Event
  • userTask - Benutzer-Aufgabe
  • serviceTask - Service-Task
  • scriptTask - Script-Task
  • exclusiveGateway - Exklusives Gateway
  • parallelGateway - Paralleles Gateway

Ausführungshistorie anzeigen

const flowNodes = await client.getFlowNodeInstances({ processInstanceId, state: 'finished', }); console.log('=== Prozess-Ablauf ==='); flowNodes.forEach((flowNode, index) => { console.log(`${index + 1}. ${flowNode.flowNodeId} (${flowNode.flowNodeType})`); console.log(` Gestartet: ${flowNode.createdAt}`); console.log(` Beendet: ${flowNode.finishedAt}`); });

Start- und End-Events finden

const flowNodes = await client.getFlowNodeInstances({ processInstanceId, }); const startEvent = flowNodes.find((fn) => fn.flowNodeType === 'startEvent'); const endEvent = flowNodes.find((fn) => fn.flowNodeType === 'endEvent'); console.log(`Start: ${startEvent?.flowNodeId}`); console.log(`Ende: ${endEvent?.flowNodeId}`);

Nächste Schritte