How to use the workit-core.IoC.bindToObject 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 / 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);