Skip to Content
Client LibrariesTypeScriptTypeScript Client

TypeScript Client

TypeScript-Client zur Kommunikation mit der ProcessCube® Engine via REST und Socket.IO.

  • Paketname: @5minds/processcube_engine_client
  • Plattformen: Node.js, Browser

Installation

npm install @5minds/processcube_engine_client

Schnelleinstieg

import { EngineClient } from '@5minds/processcube_engine_client'; const client = new EngineClient('http://localhost:10560'); const processInstances = await client.processInstances.query({ correlationId: 'my-correlation-id', });

Architektur

Der Client ist modular aufgebaut. Der EngineClient buendelt spezialisierte Sub-Clients, die jeweils einen fachlichen Bereich der Engine abdecken. Die Kommunikation erfolgt ueber REST (HTTP) und Socket.IO (WebSocket).

EngineClient

Der EngineClient ist der zentrale Einstiegspunkt. Er erstellt alle Sub-Clients und verwaltet die Socket.IO-Verbindung.

import { EngineClient } from '@5minds/processcube_engine_client'; const client = new EngineClient('http://localhost:10560'); // Sub-Clients als Properties client.processModels; client.processInstances; client.userTasks; client.externalTasks; client.manualTasks; client.correlations; client.events; client.notification; client.processDefinitions; client.cronjobs; client.flowNodeInstances; client.dataObjectInstances; client.applicationInfo; client.untypedTasks; // Aufraeumen client.dispose();

ClientFactory

Alternativ lassen sich einzelne Clients gezielt erstellen:

import { ClientFactory } from '@5minds/processcube_engine_client'; const engineUrl = 'http://localhost:10560'; const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUrl); const processInstances = await processInstanceClient.query({ correlationId: 'my-correlation-id', });

Factory-Methoden

MethodeBeschreibung
createProcessModelClient()Prozessmodelle deployen, starten, abfragen
createProcessInstanceClient()Prozessinstanzen abfragen und verwalten
createProcessDefinitionClient()Prozessdefinitionen verwalten
createUserTaskClient()UserTasks abfragen und abschliessen
createExternalTaskClient()ExternalTasks abonnieren und verarbeiten
createManualTaskClient()ManualTasks abfragen und abschliessen
createUntypedTaskClient()Untypisierte Tasks verwalten
createCorrelationClient()Correlations abfragen
createEventClient()BPMN-Events senden und empfangen
createNotificationClient()Echtzeit-Benachrichtigungen
createCronJobClient()Cronjobs verwalten
createFlowNodeInstanceClient()FlowNode-Instanzen abfragen
createDataObjectInstanceClient()DataObjects abfragen
createApplicationInfoClient()Engine-Metadaten abfragen

Alle verfuegbaren Clients

ClientPropertyBeschreibung
ProcessModelClientclient.processModelsProzessmodelle deployen, starten, abfragen
ProcessInstanceClientclient.processInstancesLaufende und abgeschlossene Prozessinstanzen
ProcessDefinitionClientclient.processDefinitionsProzessdefinitionen (BPMN-XML) verwalten
UserTaskClientclient.userTasksUserTasks abfragen und abschliessen
ExternalTaskClientclient.externalTasksExternalTasks abonnieren und verarbeiten
ManualTaskClientclient.manualTasksManualTasks abfragen und abschliessen
UntypedTaskClientclient.untypedTasksUntypisierte Tasks verwalten
CorrelationClientclient.correlationsCorrelations abfragen
EventClientclient.eventsBPMN-Message/Signal-Events senden
NotificationClientclient.notificationEchtzeit-Events ueber Socket.IO
CronjobClientclient.cronjobsZeitgesteuerte Prozesse verwalten
FlowNodeInstanceClientclient.flowNodeInstancesFlowNode-Instanzen abfragen
DataObjectInstanceClientclient.dataObjectInstancesProzess-Datenobjekte abfragen
ApplicationInfoClientclient.applicationInfoEngine-Version und Metadaten

Weiterfuehrende Themen