Penstock

Guide / Every rule

A worker reads a variable it does not fetch

The check code/worker-fetch, in the group Diagrams and code.

AdvicePro

Why it matters

A Camunda 8 worker is given only the variables it asks for, so a name its code reads but its fetch list leaves out is null at runtime, and a name a fetch list holds under a different spelling is null as well.

How to fix it

Add the variable to the worker's fetchVariables, or use the name it fetches.

Where you see it

The Problems tab lists it under Code. In a terminal, penstock code reports it with the file and line. This check is part of Penstock Pro, and Team in a pipeline.

Rule details

Idcode/worker-fetch
GroupDiagrams and code
LevelAdvice: it works, and reads or runs better without it

Read more: Code links. All rules: Every rule.