
Security News
Rust RFC Proposes a Security Tab on crates.io for RustSec Advisories
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
@5minds/processcube_engine_client
Advanced tools
Contains a typescript based client for accessing the Engine.
Ein NodeJS basierter Client zur Kommunikation mit der ProcessCube Engine.
import { EngineClient } from '@5minds/processcube_engine_client';
const engineUri = 'http://localhost:10560';
const client = new EngineClient(engineUri);
const processInstancesInCorrelation = await client.processInstances.query({
correlationid: 'my-correlation-id',
});
Man benötigt lediglich die URL der anzusteuernden Engine. Mit dieser lässt sich eine Instanz des Clients anlegen, die direkt verwendbar ist.
Es gibt verschiedene Wege sich Clients anzulegen.
Man kann eine Instanz des EngineClients direkt anlegen, welche die API der ProcessCube Engine vollständig abdeckt.
import { EngineClient } from '@5minds/processcube_engine_client';
const engineUri = 'http://localhost:10560';
const client = new EngineClient(engineUri);
const processInstancesInCorrelation = await client.processInstances.query({
correlationid: 'my-correlation-id',
});
Oder man kann sich über die Client Factory einen feature-spezifischen Client anlegen, der nur einen besimmten fachlichen Aspekt der ProcessCube Engine abdeckt.
Beispiel:
import { ClientFactory } from '@5minds/processcube_engine_client';
const engineUri = 'http://localhost:10560';
const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);
const processInstances = await processInstanceClient.query({
correlationid: 'my-correlation-id',
});
Hier wird eine Client Instanz angelegt, welche lediglich die Interaktion mit Prozessinstanzen abdeckt.
Nachfolgend werden ein paar der am häufigsten verwendeten Use Cases demonstriert.
Das Starten von Prozessinstanzen kann über die EngineClient.processModels Fachlichkeit realisiert werden.
Prozesse lassen sich auf mehrere Arten starten.
import { EngineClient } from '@5minds/processcube_engine_client';
const engineUri = 'http://localhost:10560';
const client = new EngineClient(engineUri);
await client.processModels.startProcessInstance({ processModelId: 'myProcessModelId' });
Die processModelId ist der einzige erforderliche Parameter für diesen Request.
Der Client wartet in diesem Szenario nur, bis die Engine den Start des Prozesses bestätigt hat.
Neben der processModelId können folgende Paramter mitgegeben werden:
startEventId: Die ID des Start Events von welchem aus der Prozess losgehen soll
correlationId: Gibt an, in welcher Correlation die Prozessinstanz laufen sollinitialToken: Der JSON-formatierte Prozess-Token, den die Prozessinstanz zu beginn besitzen sollimport { EngineClient } from '@5minds/processcube_engine_client';
const engineUri = 'http://localhost:10560';
const client = new EngineClient(engineUri);
await client.processModels.startProcessInstance({
processModelId: 'myProcessModelId',
startEventId: 'StartEvent_1',
correlationId: 'MyCorrelatioNid',
initialToken: {
hello: 'world',
},
});
import { EngineClient } from '@5minds/processcube_engine_client';
const engineUri = 'http://localhost:10560';
const client = new EngineClient(engineUri);
await client.processModels.startProcessInstanceAndAwaitEndEvent({ processModelId: 'myProcessModelId' });
Hier wartet der Client, bis die Engine den Prozess bis zum Ende ausgeführt hat.
Die Methode akzeptiert dieselben Parameter wie processModels.startProcessInstance.
Abfragen aller User Tasks eines bestimmten Prozesses, die sich in einem "suspended" State befinden:
import { EngineClient, DataModels } from '@5minds/processcube_engine_client';
const engineUri = 'http://localhost:10560';
const client = new EngineClient(engineUri);
const userTasks = await client.userTasks.query({
processModelId: 'myProcessModelId',
state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,
});
console.log(userTasks);
External Task Worker werden dazu benutzt, um die an einer Prozessinstanz anfallenden External Service Tasks zu verarbeiten.
Ein Worker benötigt minimal die folgenden 3 Einstellungen
Beispiel:
import { ExternalTaskWorker } from '@5minds/processcube_engine_client';
interface AddPayload {
number1: number;
number2: number;
}
interface AddResult {
sum: number;
}
const engineUri = 'http://localhost:10560';
const topic = 'sum_numbers';
const externalTaskWorker = new ExternalTaskWorker<AddPayload, AddResult>(url, topic, doAdd, config);
externalTaskWorker.start();
async function doAdd(payload: AddPayload, externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>): Promise<AddResult> {
const result: AddResult = {
sum: payload.number1 + payload.number2,
};
return result;
}
Der Worker lässt sich mit folgendem Befehl starten:
externalTaskWorker.start();
und mit folgendem Befehl stoppen:
externalTaskWorker.stop();
Ein ausführbares Code-Beispiel findet sich hier.
FAQs
Contains a typescript based client for accessing the Engine.
The npm package @5minds/processcube_engine_client receives a total of 1,688 weekly downloads. As such, @5minds/processcube_engine_client popularity was classified as popular.
We found that @5minds/processcube_engine_client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.

Security News
/Research
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.

Research
/Security Fundamentals
A pair of typosquatted Go packages posing as Google’s UUID library quietly turn helper functions into encrypted exfiltration channels to a paste site, putting developer and CI data at risk.