Canceled task in transaction but output is still evalued

hello *body,

I have a transaction with a task with some output.
(It create the variable “titi” from the variable “toto” created by the Task)

This transaction have a Signal Boundary attached.

When a signal is catch, i get a error about the “output”

Cause: Cannot resolve identifier ‘toto

Did i miss something ?

thank you

camunda-cancel

What exactly are you trying to do?

I want to cancel a workflow (and excute a compensation) if i get a signal from another worklow.

(“got error” is badly named)

If i set the variable “toto” in another task, it works:

  • when signal is catch, all transaction is cancel
    camunda-cancel-separate-task

if i replace the output expression:
${ toto }
with
${ execution.hasVariable(“toto”) ? execution.getVariable(“toto”) : “null”}

=> i do not get any “cannot resolve identifier toto”

But now the User can forget to set the “toto” variable, which is need by the workflow

If this is your goal, you’re using the BPMN symbols in a way that is a little confusing. Try something like this:

what is confusing ?

I want to cancel the whole transaction, with no compensation.
When the event arrives, the output of the current task is evaluated (and sadly it depends on a variable created by the task)

(in my real life, there are many tasks in the transactions)

Your use of the terminology.

When you say transaction - what do you mean? There is a transaction symbol in BPMN that you’re using here but there are also transactions from the engine’s perspective which you might not be aware of.
When you say cancel - what do you expect to happen? from a process and technical level.

How do you define compensation? asynchronous execution of another task that performs a compensation or the rolling back of a threads execution.

This seems to indicate that the event is dependent on the output of the task - but you’ve used an interrupting event in your model, so I’m not sure how you expect the event to get an output from a task that hasn’t been completed.

When i say “transaction”, i mean the BPMN Transaction.

I want to end the BPMN Transaction in case of a signal is received as described in:
(https://docs.camunda.org/manual/7.13/reference/bpmn20/subprocesses/transaction-subprocess/)

When it happened, there are active task in the BPMN Transaction, and their output is evaluated.

In my case, the output depends on variables set by the Task (External Task or User Task), so when the task is canceled, i got a incident because the variable is absent.

I managed to make it works, using a groovy script in the output:

out = null;
if (! execution.isCanceled() ) {
  out = execution.getVariable("titi");
}
out