I am receiving the following error “Condition expression returns non-Boolean: Result has class java.lang.String and not java.lang.Boolean” when I’m trying to run the following script;
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: ‘creditScoreChecker’
client.subscribe(“DecideOnExpansion”, async function({ task, taskService }) {
// Put your business logic
var north = Math.random() >= 0.5;
const variables = new Variables();
variables.set("north", north);
// complete the task
await taskService.complete(task, variables); //error happens at this line of code
});
Enclosed is the error I receive from Nodejs.