camunda-community-hub / nestjs-zeebe

Zeebe transport and client for nestjs framework
MIT License
24 stars 11 forks source link

worker can not subscribe camunda8 service #14

Closed jinguo-yin closed 9 months ago

jinguo-yin commented 9 months ago

I use @ZeebeWorker subscribe zeebe event, but can not called when I create a ProcessInstance。 but I use pure zeebe-node,all is OK.

nestjs-zeebe code: @ZeebeWorker('demo-service') demoService(@Payload() job: ZeebeJob, @Ctx() context: any) { console.log('context is: ', context); console.log('demo-service task variables: ', job.variables); job.complete(); }

and zeebe-node code(i use postman call this function): @Get('createWorker') getTaskList() { this.zbClient.createWorker({ taskType: 'demo-service', taskHandler: taskHandler,

  onReady: () => console.log('worker connected'),
  onConnectionError: () => console.log('Worker disconnected'),
});

return 'tasklist';

} }

function taskHandler(job: ZeebeJob) { console.log('job', job.variables); return job.complete(); }

jinguo-yin commented 9 months ago

I resolve this question