Cannot resolve boolean identifier

Hi Camunda Community!

I am new to Camunda so please excuse my ignorance on some of the areas.

I am basically following the great tutorials I have found online from @Niall and am stuck on this particular one: watch?v=l6pMXr8Jf6k&t=866s

The problem is that when I launch my process and set the JSWorker to pick up the topic, Camunda comes back with an error:

Error: {"type":"ProcessEngineException","message":"Unknown property used in expression: #{north}. Cause: Cannot resolve identifier 'north'"}; Type: undefined

I have found a similar topic in the community forum (7666) and followed everything that was suggested but still nothing works.

I am using the Community Edition of Camunda: camunda-bpm-tomcat-7.13.0

BPMN File: RomeInvades.bpmn (6.6 KB)

Spent hours on this, so any help would be massively appreciated!

Thanks,

Alex G

The link to video mentioned: https://www.youtube.com/watch?v=l6pMXr8Jf6k&t=866s

Hi @Alex_G

Welcome to the forum.
Can you show me the code for your worker as well?

Sure thing, here it is:
DecideOnExpansionWorker.txt (806 Bytes)

Looks like you where just missing the part where you put the variables in the complete call.
This should do the trick

const { Client, logger } = require("camunda-external-task-client-js");
const { Variables } = require("camunda-external-task-client-js");

// configuration for the Client:
//  - 'baseUrl': url to the Workflow Engine
//  - 'logger': utility to automatically log important events
const config = { baseUrl: "http://localhost:8080/engine-rest", use: logger };

// create a Client instance with custom configuration
const client = new Client(config);

// susbscribe to the topic: 'DecideOnExpansion'
client.subscribe("DecideOnExpansion", async function({ task, taskService }) {
  // Put your business logic

  var north = Math.random() >= 0.5;
  const processVariables = new Variables();
  processVariables.set("north", north);

  // complete the task
  await taskService.complete(task, processVariables);
});

Oh my… I knew it was something mega-silly on my side! That has done it.

Niall thanks for such speedy response, I will continue with the tutorials now.

Delighted to hear it!
Have fun :slight_smile:

1 Like