client.subscribe(‘http-request’, async ({
task,
taskService
}) => {
const result = {
‘id’: task.activityId,
‘name’: ‘name-task’
};
const processVariables = new Variables();
const localVariables = new Variables();
processVariables.set(Result
, result);
await taskService.complete(task, processVariables, localVariables);
});
client.subscribe(‘mapper’, async ({
task,
taskService
}) => {
const processVariables = new Variables();
const result = task.variables.get(Result
);
console.log(‘result—>>’, result);
await taskService.complete(task, processVariables);
});
we are using external tasks with javascript implementation
so using this diagram :
now process variables are global over the process , so it will be one variable called result in both
set by all http-request tasks,
but I need mapper1 to be executed with data from http-request1 task,
and mapper2 to be executed with data from http-request2 task