Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying user task with linked Camunda form not working #4658

Closed
philippfromme opened this issue Nov 1, 2024 · 3 comments · Fixed by #4711
Closed

Copying user task with linked Camunda form not working #4658

philippfromme opened this issue Nov 1, 2024 · 3 comments · Fixed by #4711
Assignees
Labels
bug Something isn't working
Milestone

Comments

@philippfromme
Copy link
Contributor

Describe the bug

When copying a user task with a linked Camunda form the result is unexpected.

Camunda_Modeler_JRT1orWwcx

The XML before:

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0uh0gs4" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.28.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.6.0">
  <bpmn:process id="Process_1" isExecutable="true">
    <bpmn:userTask id="Activity_1">
      <bpmn:extensionElements>
        <zeebe:formDefinition formId="foo" />
      </bpmn:extensionElements>
    </bpmn:userTask>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
      <bpmndi:BPMNShape id="Activity_0ftdgvn_di" bpmnElement="Activity_1">
        <dc:Bounds x="160" y="70" width="100" height="80" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

The XML after:

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0uh0gs4" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.28.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.6.0">
  <bpmn:process id="Process_1" isExecutable="true">
    <bpmn:extensionElements>
      <zeebe:userTaskForm id="UserTaskForm_1baiutt"></zeebe:userTaskForm>
    </bpmn:extensionElements>
    <bpmn:userTask id="Activity_1">
      <bpmn:extensionElements>
        <zeebe:formDefinition formId="foo" />
      </bpmn:extensionElements>
    </bpmn:userTask>
    <bpmn:userTask id="Activity_2">
      <bpmn:extensionElements>
        <zeebe:formDefinition formKey="camunda-forms:bpmn:UserTaskForm_1baiutt" />
      </bpmn:extensionElements>
    </bpmn:userTask>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
      <bpmndi:BPMNShape id="Activity_0ftdgvn_di" bpmnElement="Activity_1">
        <dc:Bounds x="160" y="70" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_0t8htyd" bpmnElement="Activity_2">
        <dc:Bounds x="290" y="70" width="100" height="80" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

For some reason the pasted user task has a form key instead of a form ID indicating that the copy-paste behavior is broken.

Steps to reproduce

  1. Create user task with form ID
  2. Copy and paste
  3. Pasted user task has form key instead of form ID

Expected behavior

Pasted user task has same form ID.

Environment

  • Camunda Modeler Version: 5.28

Additional context

Slack: https://camunda.slack.com/archives/C0693F1NFK5/p1730297588684999

@philippfromme philippfromme added the bug Something isn't working label Nov 1, 2024
@philippfromme philippfromme self-assigned this Nov 1, 2024
philippfromme added a commit to camunda/camunda-bpmn-js-behaviors that referenced this issue Nov 1, 2024
@philippfromme
Copy link
Contributor Author

Root cause

Our form definition behavior creates a new form definition and user task form when a user task is created that has an existing form definition. The idea was that you don't end up referencing the same user task form when copying and pasting a user task. Copying and pasting a user task with a form definition will remove the form definition and its form ID. We need to change the behavior so that a new user task form is only created if the existing form definition references a user task form that is already referenced by another form definition.

philippfromme added a commit to camunda/camunda-bpmn-js-behaviors that referenced this issue Nov 1, 2024
@nikku nikku added the in progress Currently worked on label Nov 1, 2024 — with bpmn-io-tasks
@philippfromme philippfromme added the needs review Review pending label Nov 4, 2024 — with bpmn-io-tasks
@philippfromme philippfromme removed the in progress Currently worked on label Nov 4, 2024
barmac pushed a commit to camunda/camunda-bpmn-js-behaviors that referenced this issue Nov 15, 2024
@nikku
Copy link
Member

nikku commented Nov 19, 2024

What is the status here? Looks like this should be fixed upstream instead?

philippfromme added a commit to camunda/camunda-bpmn-js-behaviors that referenced this issue Nov 19, 2024
@philippfromme philippfromme added fixed upstream Requires integration of upstream change and removed needs review Review pending labels Nov 19, 2024
@nikku
Copy link
Member

nikku commented Nov 20, 2024

Depends on camunda/camunda-bpmn-js#393 to be released and incorporated.

nikku added a commit that referenced this issue Nov 20, 2024
@nikku nikku mentioned this issue Nov 20, 2024
4 tasks
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Nov 20, 2024
@bpmn-io-tasks bpmn-io-tasks bot removed the fixed upstream Requires integration of upstream change label Nov 20, 2024
nikku added a commit that referenced this issue Nov 20, 2024
@nikku nikku added this to the M83 milestone Nov 21, 2024
nikku added a commit that referenced this issue Nov 21, 2024
@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on needs review Review pending and removed needs review Review pending in progress Currently worked on labels Nov 21, 2024
@barmac barmac closed this as completed in a12ad77 Nov 21, 2024
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants