Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(async() => {
const zbc = new ZB.ZBClient("localhost:26500");
// const topology = await zbc.topology();
// console.log(JSON.stringify(topology, null, 2));
// let workflows = await zbc.listWorkflows();
// console.log(workflows);
await zbc.deployWorkflow(process.cwd()+'/sample/zeebe/test.bpmn');
// workflows = await zbc.listWorkflows();
// console.log(workflows);
// const zbWorker = zbc.createWorker("test-worker", "demo-service", handler);
zbc.publishMessage();
zbc.publishStartMessage();
zbc.failJob();
})();
constructor(
config: IZeebeOptions,
@optional() client?: ZBClient,
@optional() exporterConfig?: Partial
) {
this._client = client || new ZBClient(config.baseUrl, config);
this._config = config;
this._exporterConfig = exporterConfig;
if (!exporterConfig) {
// tslint:disable-next-line: no-console
console.log(
"warning: no exporterConfig has been provided to Zeebe. getWorkflow and getWorkflows methods won't work. "
);
}
this._exporterClient = new ZBElasticClient(new Configs(exporterConfig));
}
public subscribe(
(async() => {
const zbc = new ZB.ZBClient("localhost:26500");
const topology = await zbc.topology();
console.log(JSON.stringify(topology, null, 2));
let workflows = await zbc.listWorkflows();
console.log(workflows);
await zbc.deployWorkflow('./test.bpmn');
workflows = await zbc.listWorkflows();
console.log(workflows);
})();
(async () => {
const zbc = new ZB.ZBClient("localhost:26500");
for (let index = 0; index < 1; index++) {
const result = await zbc.createWorkflowInstance("DCI_PETITIONS_STATUS_CHANGE", {
"businessKey": "5c72b4ad21719b001009025d",
"serviceType": "petitions",
"internalStatus": "opened",
"id": "13514",
"accountIds": {
"data": [
"@!4025.CA62.9BB6.16C5!0001!2212.0010!0000!9C6F.CD68.4E14.DC40"
]
}
});
console.log(result);
}
})();
useFactory: async (config: ZeebeClientOptions ) => new ZB.ZBClient(config.gatewayAddress, config.options),
inject: [ZEEBE_OPTIONS_PROVIDER],