How to use the workit-core.IoC.bindTo function in workit-core

To help you get started, we’ve selected a few workit-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github VilledeMontreal / workit / packages / workit-camunda / sample / complex_binding.ts View on Github external
(async () => {
    enum LOCAL_IDENTIFIER {
        activity1 = 'activity_1',
        activity2 = 'activity_2',
        activity3 = 'activity_3'
    }

    const BPMN_PROCESS_ID = "BPMN_P_DEMO";

    IoC.bindTo(HelloWorldTask, LOCAL_IDENTIFIER.activity1);
    IoC.bindTo(HelloWorldTask, LOCAL_IDENTIFIER.activity2);
    IoC.bindTo(HelloWorldTask, LOCAL_IDENTIFIER.activity3);

    IoC.bindTask(HelloWorldTaskV2, LOCAL_IDENTIFIER.activity1, { bpmnProcessId: BPMN_PROCESS_ID, version: 2 });
    IoC.bindTask(HelloWorldTaskV2, LOCAL_IDENTIFIER.activity2, { bpmnProcessId: BPMN_PROCESS_ID, version: 2 });
    IoC.bindTask(HelloWorldTaskV2, LOCAL_IDENTIFIER.activity3, { bpmnProcessId: BPMN_PROCESS_ID, version: 2 });

    IoC.bindTask(HelloWorldTaskV3, LOCAL_IDENTIFIER.activity1, { bpmnProcessId: BPMN_PROCESS_ID, version: 3 });
    IoC.bindTask(HelloWorldTaskV3, LOCAL_IDENTIFIER.activity2, { bpmnProcessId: BPMN_PROCESS_ID, version: 3 });
    IoC.bindTask(HelloWorldTaskV3, LOCAL_IDENTIFIER.activity3, { bpmnProcessId: BPMN_PROCESS_ID, version: 3 });

    const worker = IoC.get(CORE_IDENTIFIER.worker, TAG.camundaBpm);
    const cm = IoC.get(CORE_IDENTIFIER.client_manager, TAG.camundaBpm);

    // const path = `${process.cwd()}/sample/BPMN_P_DEMO.bpmn`;
    // await cm.deployWorkflow(path);
    for (let index = 0; index < 1; index++) {
github VilledeMontreal / workit / packages / workit-camunda / sample / message-event.ts View on Github external
(async () => {
    enum LOCAL_IDENTIFIER {
        sample_activity = 'sample_activity'
    }

    IoC.bindTo(HelloWorldTask, LOCAL_IDENTIFIER.sample_activity);

    const worker = IoC.get(CORE_IDENTIFIER.worker, TAG.camundaBpm);
    const cm = IoC.get(CORE_IDENTIFIER.client_manager, TAG.camundaBpm);

    const path = `${ process.cwd() }/sample/MESSAGE_EVENT.bpmn`;
    await cm.deployWorkflow(path);
    await cm.publishMessage({
        correlation: {},
        name: "__MESSAGE_START_EVENT__",
        variables: { amount: 1000 },
        timeToLive: undefined,
        messageId: undefined
    });

    await cm.updateJobRetries({ jobKey: "975e1f79-518c-11e9-bd78-0242ac110003", retries: 0 });
    // setTimeout((resp) => {
github VilledeMontreal / workit / packages / workit-camunda / src / config / ioc.ts View on Github external
[SERVICE_IDENTIFIER.camunda_external_config, SERVICE_IDENTIFIER.camunda_external_client],
  TAG.camundaBpm,
  false
);

IoC.bindTo(Client, SERVICE_IDENTIFIER.client, [SERVICE_IDENTIFIER.camunda_client], null, false);
IoC.bindTo(
  Worker,
  SERVICE_IDENTIFIER.worker,
  [SERVICE_IDENTIFIER.client, SERVICE_IDENTIFIER.process_handler],
  null,
  false
);

IoC.bindTo(ZeebeManager, SERVICE_IDENTIFIER.client_manager, [SERVICE_IDENTIFIER.camunda_client], TAG.zeebe, false);
IoC.bindTo(
  CamundaManager,
  SERVICE_IDENTIFIER.client_manager,
  [SERVICE_IDENTIFIER.camunda_client],
  TAG.camundaBpm,
  false
);
IoC.bindTo(
  ZeebeWorker,
  SERVICE_IDENTIFIER.worker,
  [SERVICE_IDENTIFIER.camunda_client, SERVICE_IDENTIFIER.process_handler],
  TAG.zeebe,
  false
);
IoC.bindTo(
  CamundaBpmWorker,
  SERVICE_IDENTIFIER.worker,
github VilledeMontreal / workit / packages / workit-camunda / src / config / ioc.ts View on Github external
IoC.bindTo(ZeebeManager, SERVICE_IDENTIFIER.client_manager, [SERVICE_IDENTIFIER.camunda_client], TAG.zeebe, false);
IoC.bindTo(
  CamundaManager,
  SERVICE_IDENTIFIER.client_manager,
  [SERVICE_IDENTIFIER.camunda_client],
  TAG.camundaBpm,
  false
);
IoC.bindTo(
  ZeebeWorker,
  SERVICE_IDENTIFIER.worker,
  [SERVICE_IDENTIFIER.camunda_client, SERVICE_IDENTIFIER.process_handler],
  TAG.zeebe,
  false
);
IoC.bindTo(
  CamundaBpmWorker,
  SERVICE_IDENTIFIER.worker,
  [SERVICE_IDENTIFIER.camunda_client, SERVICE_IDENTIFIER.process_handler],
  TAG.camundaBpm,
  false
);
github VilledeMontreal / workit / packages / workit-camunda / src / config / ioc.ts View on Github external
*/

import { Client as CamundaExternalClient } from 'camunda-external-task-client-js';
import { CamundaBpmClient } from 'workit-bpm-client';
import { IoC, Worker } from 'workit-core';
import { ZeebeClient } from 'workit-zeebe-client';
import { Client } from '../camunda-n-mq/client';
import { CamundaBpmWorker } from '../camundaBpm/camundaBpmWorker';
import { CamundaManager } from '../camundaBpm/camundaManager';
import { ZeebeManager } from '../zeebe/zeebeManager';
import { ZeebeWorker } from '../zeebe/zeebeWorker';
import { SERVICE_IDENTIFIER } from './constants/identifiers';
import { TAG } from './constants/tag';
import './container';

IoC.bindTo(
  ZeebeClient,
  SERVICE_IDENTIFIER.camunda_client,
  [
    SERVICE_IDENTIFIER.zeebe_external_config,
    SERVICE_IDENTIFIER.camunda_external_client,
    SERVICE_IDENTIFIER.zeebe_elastic_exporter_config
  ],
  TAG.zeebe,
  false
);
IoC.bindTo(
  CamundaExternalClient,
  SERVICE_IDENTIFIER.camunda_external_client,
  [SERVICE_IDENTIFIER.camunda_external_config],
  null,
  false
github VilledeMontreal / workit / packages / workit-camunda / src / config / ioc.ts View on Github external
CamundaExternalClient,
  SERVICE_IDENTIFIER.camunda_external_client,
  [SERVICE_IDENTIFIER.camunda_external_config],
  null,
  false
);
IoC.bindTo(
  CamundaBpmClient,
  SERVICE_IDENTIFIER.camunda_client,
  [SERVICE_IDENTIFIER.camunda_external_config, SERVICE_IDENTIFIER.camunda_external_client],
  TAG.camundaBpm,
  false
);

IoC.bindTo(Client, SERVICE_IDENTIFIER.client, [SERVICE_IDENTIFIER.camunda_client], null, false);
IoC.bindTo(
  Worker,
  SERVICE_IDENTIFIER.worker,
  [SERVICE_IDENTIFIER.client, SERVICE_IDENTIFIER.process_handler],
  null,
  false
);

IoC.bindTo(ZeebeManager, SERVICE_IDENTIFIER.client_manager, [SERVICE_IDENTIFIER.camunda_client], TAG.zeebe, false);
IoC.bindTo(
  CamundaManager,
  SERVICE_IDENTIFIER.client_manager,
  [SERVICE_IDENTIFIER.camunda_client],
  TAG.camundaBpm,
  false
);
IoC.bindTo(
github VilledeMontreal / workit / packages / workit-camunda / src / config / ioc.ts View on Github external
IoC.bindTo(
  CamundaExternalClient,
  SERVICE_IDENTIFIER.camunda_external_client,
  [SERVICE_IDENTIFIER.camunda_external_config],
  null,
  false
);
IoC.bindTo(
  CamundaBpmClient,
  SERVICE_IDENTIFIER.camunda_client,
  [SERVICE_IDENTIFIER.camunda_external_config, SERVICE_IDENTIFIER.camunda_external_client],
  TAG.camundaBpm,
  false
);

IoC.bindTo(Client, SERVICE_IDENTIFIER.client, [SERVICE_IDENTIFIER.camunda_client], null, false);
IoC.bindTo(
  Worker,
  SERVICE_IDENTIFIER.worker,
  [SERVICE_IDENTIFIER.client, SERVICE_IDENTIFIER.process_handler],
  null,
  false
);

IoC.bindTo(ZeebeManager, SERVICE_IDENTIFIER.client_manager, [SERVICE_IDENTIFIER.camunda_client], TAG.zeebe, false);
IoC.bindTo(
  CamundaManager,
  SERVICE_IDENTIFIER.client_manager,
  [SERVICE_IDENTIFIER.camunda_client],
  TAG.camundaBpm,
  false
);
github VilledeMontreal / workit / packages / workit-camunda / src / config / ioc.ts View on Github external
Worker,
  SERVICE_IDENTIFIER.worker,
  [SERVICE_IDENTIFIER.client, SERVICE_IDENTIFIER.process_handler],
  null,
  false
);

IoC.bindTo(ZeebeManager, SERVICE_IDENTIFIER.client_manager, [SERVICE_IDENTIFIER.camunda_client], TAG.zeebe, false);
IoC.bindTo(
  CamundaManager,
  SERVICE_IDENTIFIER.client_manager,
  [SERVICE_IDENTIFIER.camunda_client],
  TAG.camundaBpm,
  false
);
IoC.bindTo(
  ZeebeWorker,
  SERVICE_IDENTIFIER.worker,
  [SERVICE_IDENTIFIER.camunda_client, SERVICE_IDENTIFIER.process_handler],
  TAG.zeebe,
  false
);
IoC.bindTo(
  CamundaBpmWorker,
  SERVICE_IDENTIFIER.worker,
  [SERVICE_IDENTIFIER.camunda_client, SERVICE_IDENTIFIER.process_handler],
  TAG.camundaBpm,
  false
);
github VilledeMontreal / workit / packages / workit-camunda / src / config / ioc.ts View on Github external
import { SERVICE_IDENTIFIER } from './constants/identifiers';
import { TAG } from './constants/tag';
import './container';

IoC.bindTo(
  ZeebeClient,
  SERVICE_IDENTIFIER.camunda_client,
  [
    SERVICE_IDENTIFIER.zeebe_external_config,
    SERVICE_IDENTIFIER.camunda_external_client,
    SERVICE_IDENTIFIER.zeebe_elastic_exporter_config
  ],
  TAG.zeebe,
  false
);
IoC.bindTo(
  CamundaExternalClient,
  SERVICE_IDENTIFIER.camunda_external_client,
  [SERVICE_IDENTIFIER.camunda_external_config],
  null,
  false
);
IoC.bindTo(
  CamundaBpmClient,
  SERVICE_IDENTIFIER.camunda_client,
  [SERVICE_IDENTIFIER.camunda_external_config, SERVICE_IDENTIFIER.camunda_external_client],
  TAG.camundaBpm,
  false
);

IoC.bindTo(Client, SERVICE_IDENTIFIER.client, [SERVICE_IDENTIFIER.camunda_client], null, false);
IoC.bindTo(
github VilledeMontreal / workit / packages / workit-camunda / sample / parallel.ts View on Github external
(async () => {
    enum LOCAL_IDENTIFIER {
        activity1 = 'activity_1',
        activity2 = 'activity_2',
        activity3 = 'activity_3'
    }

    const BPMN_PROCESS_ID = "BPMN_P_DEMO";

    IoC.bindToObject(tracerService.getTracer(), CORE_IDENTIFIER.tracer);

    IoC.bindTo(HelloWorldTask, LOCAL_IDENTIFIER.activity1);
    IoC.bindTo(HelloWorldTask, LOCAL_IDENTIFIER.activity2);
    IoC.bindTo(HelloWorldTask, LOCAL_IDENTIFIER.activity3);

    IoC.bindTask(HelloWorldTaskV2, LOCAL_IDENTIFIER.activity1, { bpmnProcessId: BPMN_PROCESS_ID, version: 2 });
    IoC.bindTask(HelloWorldTaskV2, LOCAL_IDENTIFIER.activity2, { bpmnProcessId: BPMN_PROCESS_ID, version: 2 });
    IoC.bindTask(HelloWorldTaskV2, LOCAL_IDENTIFIER.activity3, { bpmnProcessId: BPMN_PROCESS_ID, version: 2 });

    IoC.bindTask(HelloWorldTaskV3, LOCAL_IDENTIFIER.activity1, { bpmnProcessId: BPMN_PROCESS_ID, version: 3 });
    IoC.bindTask(HelloWorldTaskV3, LOCAL_IDENTIFIER.activity2, { bpmnProcessId: BPMN_PROCESS_ID, version: 3 });
    IoC.bindTask(HelloWorldTaskV3, LOCAL_IDENTIFIER.activity3, { bpmnProcessId: BPMN_PROCESS_ID, version: 3 });

    const worker = IoC.get(CORE_IDENTIFIER.worker, TAG.camundaBpm);
    const cm = IoC.get(CORE_IDENTIFIER.client_manager, TAG.camundaBpm);

    const path = `${ process.cwd() }/sample/BPMN_P_DEMO.bpmn`;
    await cm.deployWorkflow(path);