I’m following along with Niall (and his hawk) here and doing the “Roman invasion” demo for Camunda in a Distributed System.
I can’t actually create or manipulate the process variables in my javascript. I constantly get log errors saying:
couldn’t complete task XYZ, Unknown property used in expression: #{not north}. Cause: Cannot resolve identifier ‘north’
Exactly as in the video, I start with:
const { Variables } = require(“camunda-external-task-client-js”);
And my logic:
// subscribe to the topic: ‘DecideOnExpansion’
client.subscribe(“DecideOnExpansion”, async function({ task, taskService }) {
// Put your business logic
var flipcoin = Math.random() >= 0.5;
console.log("Variable flipcoin is set to ", flipcoin)
const processVariables = new Variables();
processVariables.set("north", flipcoin);
// complete the task
await taskService.complete(task);
When I run my .js with node, I’m subscribed, and I can see my task handler being called but there’s no effect on the process variables when I call .set() and I get the error above.
What am I missing?