This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public createWorker( | |
| id: string | null, | |
| taskType: string, | |
| taskHandler: ZB.ZBWorkerTaskHandler, | |
| options?: ZB.ZBWorkerOptions & ZB.ZBClientOptions, | |
| onConnectionError?: ZB.ConnectionErrorHandler | undefined | |
| ): ZBWorker | |
| public createWorker( | |
| taskType: string, | |
| taskHandler: ZB.ZBWorkerTaskHandler, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const zbWorker = zbc.createWorker(null, 'demo-service', handler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| createWorker( | |
| id: string | null, | |
| taskType: string, | |
| taskHandler: ZB.ZBWorkerTaskHandler, | |
| options?: ZBWorkerOptions & ZBClientOptions, | |
| onConnectionError?: ZB.ConnectionErrorHandler | undefined): ZBWorker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const zbWorker = zbc.createWorker('demo-worker-1', 'demo-service', handler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| createWorker( | |
| id: string, | |
| taskType: string, | |
| taskHandler: ZB.ZBWorkerTaskHandler, | |
| options?: ZBWorkerOptions & ZBClientOptions, | |
| onConnectionError?: ZB.ConnectionErrorHandler): ZBWorker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public createWorker( | |
| id: string | null, | |
| taskType: string, | |
| taskHandler: ZB.ZBWorkerTaskHandler, | |
| options: ZB.ZBWorkerOptions & ZB.ZBClientOptions = {} as any, | |
| onConnectionError?: ZB.ConnectionErrorHandler | |
| ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public async deployWorkflow( | |
| workflow: ZB.DeployWorkflowFiles | ZB.DeployWorkflowBuffer | |
| ): Promise<ZB.DeployWorkflowResponse> { | |
| const deploy = (workflows: ZB.WorkflowRequestObject[]) => | |
| this.executeOperation('deployWorkflow', () => | |
| this.gRPCClient.deployWorkflowSync({ | |
| workflows, | |
| }) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const filereader = wf => typeof wf === 'object' ? wf : read(wf) | |
| const read = filename => fs.existsSync(filename) ? | |
| { buffer: fs.readFileSync(filename) } : | |
| { error: filename } | |
| const outcomes = workflows.map(filereader) | |
| const { error, buffer } = outcomes.reduce((acc, o) => o.error ? | |
| { error: [...acc.error, o.error], buffer: acc.buffer } : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * | |
| * @param workflow - A path or array of paths to .bpmn files or an object describing the workflow | |
| * @param {redeploy?: boolean} - Redeploy workflow. Defaults to true. | |
| * If set false, will not redeploy a workflow that exists. | |
| */ | |
| public async deployWorkflow( | |
| workflow: string | string[] | { definition: Buffer; name: string } | |
| ): Promise<ZB.DeployWorkflowResponse> { | |
| const workflows = Array.isArray(workflow) ? workflow : [workflow] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * | |
| * @param workflow - A path or array of paths to .bpmn files or an object describing the workflow | |
| */ | |
| public async deployWorkflow( | |
| workflow: ZB.DeployWorkflowFiles | ZB.DeployWorkflowBuffer | |
| ): Promise<ZB.DeployWorkflowResponse> { | |
| const isBuffer = ( | |
| wf: ZB.DeployWorkflowBuffer | ZB.DeployWorkflowFiles | |
| ): wf is ZB.DeployWorkflowBuffer => |