Can't find the Topic name

I am new to Camunda. I am trying to to video tutorial 3 of Camunda. But in my cockpit screen I cannot see my topic name like the video. This is my screen. How can I solve it ? By the way, where I can find these fields : External tasks, Variables, Jobs, Usertask ?

Also, when I run on Nodejs, the terminal comes in endless loop at polling. How can i solve it ?

Hi, compare the URLS in the video and your screenshot. In the Video a particular process instances is selected, hence you can access the Variables, incidents, etc belonging to this instance. In your screenshot you have selected the process definition.

You can click on the tab process instances to see a list of running instances for this process definition. If you then click on one of those instances you will get to the screen shown in the video. Once you have selected a process instance you will be able to drill down further e.g. to the external task instances belonging to this instance. In the list of external tasks you will see the topics they belong to.

The external worker will keep polling / checking for new task in the topic it has subscribed to until it is stopped.

There are parameters to help control the check frequency, how many task are fetched at once, long polling (how long to wait for a task in each blocking call) , and even how the frequency changes if there are no work items. These parameters help avoid unnecessary network traffic during idle times or bothering the server with too many requests.

You can terminate the worker with Ctrl-C.

Yes I can terminate it. But I follow every step of the video, I can not complete the task Decide on Direction of Expansion like the video, eventhough I subcribled to topic. Here is my BPM file, can you please check it ? diagram_1.bpmn (6.5 KB) . It still keep polling without complete the task.

You correctly configured the topic decideonexpand in your bpmn. In your worker screenshot I also see the worker successfully

  • subscribed to the topic
  • fetched 1 task.
  • determined the value of north to be false

From the screenshot I cannot tell if the task was successfully complete though.
Can you see activity in the server log shortly after the client shows “polled 1 tasks”?
You could also add some logging around the task completion, e.g.

 // complete the task
  try {
    await taskService.complete(task, processVariables);
    console.log("I completed my task successfully!!");
  } catch (e) {
    console.error(`Failed completing my task, ${e}`);
  }

Is the process instance still waiting in the external task instance after the worker detected the task (check runtime view of process instance in cockpit. Has the instance moved on to Gaul or Persia?)

Thank you for the code. After it had fetched 1 task, it didn’t compelete the task and didn’t move to Gaul or Persia. It stuck at polling 0 tasks. After I return to my cockpit it still stand at “decide on direction”. Here is my Nodejs code. Please check it. Thanks.

{

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(“decideonexpand”, async function({ task, taskService }) {

// Put your business logic

// complete the task

try{

var north=Math.random()>=0.5;

const processVariables=new Variables();

processVariables.set(“north”,north);

console.log(“I completed my task successfully!!”);

await taskService.complete(task,processVariables);

} catch(e){

    console.error(`Failed completing my task, ${e}`);

}

});
}

Does this mean it had move ?

Congrats, your screenshot shows that the external task it is waiting at now is “Gaul”. This implies that the task “Decide on decision” for the topic “decideonexpand” was successfully completed. If you click on the link for the process instance in the bottom section of the cockpit window then you should see more detail for the instance incl. a Variables tab with the value of the north variable your worker submitted.

1 Like