Penstock

JetBrains / Using it

Code links in the IDE

In a JetBrains IDE, code links let you click from a string in your Java or Kotlin code to the diagram element it names, and back.

Pro Team in a pipeline. Going from a Camunda 7 delegate to its class is free.

What code links are, and what they check, is described once in Code links. This page is about the IDE features that use them. All of them need Pro, except going from a Camunda 7 task to its Java class or Spring bean. Without Pro, only class and bean links appear, and an action that needs the rest says what it gives and offers to buy or sign in.

From code to diagram

A process id, element id, job type, topic, message name or decision id in a Java or Kotlin string is a link.

  1. Hold Cmd (or Ctrl) and click the string, or use Go to Declaration.
  2. The diagram opens and the element is selected. Any navigation into a diagram file selects the element on the canvas.

From diagram to code

Element references in comments and strings

A reference to an element can be written in a comment or a string, in any language: the file name or path of the diagram, then # and the element id, as in order.bpmn#ServiceTask_charge, or a process id then # and the element id. Ctrl or Cmd and click opens the diagram with that element selected. Completion after # offers the ids of the diagram that is named. An id that no diagram has is marked, and a quick fix offers the near ones.

Inspections and quick fixes

The marks above come from inspections in the group Penstock of Settings | Editor | Inspections, so each can be switched off. They are listed in Settings in the IDE. The quick fixes are Change to a near name, Name the job type in an annotation, and Use an element id from the diagrams.

Element templates from a worker

Right-click a @JobWorker method, a newWorker().jobType(...) registration or a Camunda 7 external task subscription and choose Create element template. It writes the template of the job type or topic into .camunda/element-templates, with one field for each variable the worker reads, and the variables it sets as output mappings. A template that exists for that job type is updated, and the labels and descriptions you wrote are kept. The tool window shows which worker a template came from. See Element templates.

The debugger

When the debugger stops in a job worker, an external task handler, a JavaDelegate or a task listener, the diagram marks the task it is running for, with the process instance. The position is read while the debugger is paused, and again when you pick another stack frame, so it follows the frame you are looking at. On Camunda 7, Operaton and CIB seven it marks the other active elements of that instance too. The tool window lists the same under Debug. The marks go when the program resumes.

Other repositories and other languages

Name other repositories under linked in penstock.yaml. Workers in Java, Kotlin, JavaScript, TypeScript, Python, Go or C# are found by reading their text, so a worker in another repository, or in a language the IDE does not know, still counts as a task's implementation.

What you see

Common problems

No links, no gutter icons.
Code links need Pro. The tool window shows a Code line with Buy or Sign In….
Click-through works in Java but not in another language.
Completion and click-through are for Java and Kotlin. The check against the code reads more languages.
A worker in another repository is reported as missing.
Add that repository to linked in penstock.yaml.