camunda/camunda-modeler

Signal throw event inputs not copied when using copy & paste

philippfromme opened this issue · 4 comments

Describe the bug

When copying and pasting a signal throw event with inputs the inputs aren't copied (compare to message throw event).

Camunda_Modeler_xFFg5nfRku

Steps to reproduce

  1. Create signal throw event
  2. Add inputs
  3. Copy and paste
  4. Inputs not copied

Expected behavior

Inputs copied.

Environment

  • Camunda Modeler Version: 5.29.0

Additional context

This issue points to a deeper issue. We have multiple sources of truth for whether an element can have inputs and/or outputs:

  • zeebe-bpmn-moddle - allowedIn is not sufficient as we can only specify types (e.g., bpmn:Event) but not event definition types (e.g., bpmn:MessageEventDefinition) or other properties
  • bpmn-js-properties-panel - combines allowedIn with custom checks (e.g., is the element a bpmn:IntermediateThrowEvent with a bpmn:SignalEventDefinition)
  • camunda-bpmn-js-behaviors - combines allowedIn with custom checks but they are different from the ones in bpmn-js-properties-panel (no single source of truth)

The documentation doesn't tell me what elements support inputs and/or outputs so I asked. The outcome is this list:

Input mappings:

  • Call activity
  • Event sub process
  • Sub process
  • End event
    • Message
    • Signal
    • So no input mappings for None, Error, Terminate, Escalation, Compensation
  • Intermediate catch event
    • All except link
  • Intermediate throw event
    • Message
    • Signal
    • So no input mappings for None, Link, Escalation, Compensation
  • Business rule task
  • Job worker task
    • Every element that's implemented as a job worker
  • Receive task
  • Script task
  • User task

Output mappings:

  • Call activity
  • Event sub process
  • Sub process
  • Boundary event
    • All types
  • End event
    • Escalation
    • Message
    • None
    • Signal
    • So no output mappings for Error, Terminate and Compensation
  • Intermediate catch event
    • Escalation
    • Link
    • Message
    • None
    • Signal
    • So no output mappings for Compensation
  • Start event
    • All types
  • Business rule task
  • Job worker task
    • Every element that's implemented as a job worker
  • Receive task
  • Script task
  • User task

Job worker tasks are:

  • Service task
  • Send task
  • Business rule task
  • Script task
  • User task

Where Business rule, script and user tasks have an alternative way of implementing, but both those ways have input/output mappings

I'd like to make sure that we

  1. Make sure the checks when copying and pasting are the same as when showing the properties panel
  2. Make sure that what we define in zeebe-bpmn-moddle is correct

Where would you expect the single source of truth to be implemented?

@barmac I'm not sure it's easily possible. We have the same problem with many other properties. But at least we should make sure bpmn-properties-panel and camunda-bpmn-js-behaviors work the same.

In today's session with @misiekhardcore, we discussed this topic. We noticed that the CopyPasteBehavior is not strictly a behavior in the diagram-js meaning as it's not a Command Interceptor, and only reacts to events via direct subscription on EventBus. The component's API resembles more BpmnRules. @misiekhardcore suggested that both copy/paste and properties panel entries visibility are controlled much in the rules way, so we could employ rules to steer it.
This is a great topic for the hour of code.