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

receiveTask instantiate attribute is ignored #346

Closed
paule96 opened this issue Jun 17, 2024 · 8 comments
Closed

receiveTask instantiate attribute is ignored #346

paule96 opened this issue Jun 17, 2024 · 8 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request Server
Milestone

Comments

@paule96
Copy link

paule96 commented Jun 17, 2024

In the BPMN specification the following is written:

A Receive Task is often used to start a Process. In a sense, the Process is bootstrapped by the receipt of the
Message. In order for the Receive Task to instantiate the Process its instantiate attribute MUST be set to true
and it MUST NOT have any incoming Sequence Flow.

Page 161

But if you set the instantiate the open bpmn editor still complains about the misconfigured task:

image

The following xml was used to produce the error:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bpmn2:definitions xmlns:bpmn2="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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:open-bpmn="http://open-bpmn.org/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exporter="org.openbpmn" exporterVersion="1.0.0" targetNamespace="http://open-bpmn.org">
  <bpmn2:collaboration id="collaboration_1" name="Default Collaboration">
    <bpmn2:participant id="participant_0I2dYg" name="Default Process" processRef="process_1"/>
    <bpmn2:participant id="participant_GbLEaw" name="Pool-1" processRef="process_OjymFw">
      <bpmn2:documentation id="documentation_4zKKnw"/>
    </bpmn2:participant>
    <bpmn2:messageFlow id="messageFlow_OMPswg" sourceRef="task_q8rRmw" targetRef="message_4PfvrA">
      <bpmn2:documentation id="documentation_hTNA2Q"/>
    </bpmn2:messageFlow>
    <bpmn2:messageFlow id="messageFlow_oBGang" sourceRef="message_4PfvrA" targetRef="task_MPPyxg">
      <bpmn2:documentation id="documentation_ucWESg"/>
    </bpmn2:messageFlow>
  </bpmn2:collaboration>
  <bpmn2:extensionElements>
    <open-bpmn:auto-align>true</open-bpmn:auto-align>
  </bpmn2:extensionElements>
  <bpmn2:process definitionalCollaborationRef="collaboration_1" id="process_1" name="Default Process" processType="Public">
    <bpmn2:documentation id="documentation_pmvNIw"/>
    <bpmn2:startEvent id="event_rpeOwg" name="Event-3">
      <bpmn2:documentation id="documentation_S5VhJg"/>
      <bpmn2:outgoing>sequenceFlow_kERmaQ</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:endEvent id="event_yxtfvw" name="Event-4">
      <bpmn2:documentation id="documentation_Kj0f0A"/>
      <bpmn2:incoming>sequenceFlow_4engnQ</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:sequenceFlow id="sequenceFlow_kERmaQ" sourceRef="event_rpeOwg" targetRef="task_q8rRmw">
      <bpmn2:documentation id="documentation_nvwXJg"/>
    </bpmn2:sequenceFlow>
    <bpmn2:sendTask id="task_q8rRmw" name="Task-4">
      <bpmn2:documentation id="documentation_XcO46g"/>
      <bpmn2:outgoing>sequenceFlow_4engnQ</bpmn2:outgoing>
      <bpmn2:incoming>sequenceFlow_kERmaQ</bpmn2:incoming>
    </bpmn2:sendTask>
    <bpmn2:sequenceFlow id="sequenceFlow_4engnQ" sourceRef="task_q8rRmw" targetRef="event_yxtfvw">
      <bpmn2:documentation id="documentation_4wRyMw"/>
    </bpmn2:sequenceFlow>
  </bpmn2:process>
  <bpmn2:process definitionalCollaborationRef="collaboration_1" id="process_OjymFw" name="Pool-1" processType="Private">
    <bpmn2:startEvent id="event_dcKl2g" name="Start">
      <bpmn2:documentation id="documentation_cOFhHg"/>
      <bpmn2:outgoing>sequenceFlow_0bWvHA</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:userTask id="task_p9QtJg" name="Personal Data">
      <bpmn2:documentation id="documentation_Pd6zlw"/>     
      <bpmn2:incoming>sequenceFlow_0bWvHA</bpmn2:incoming>
      <bpmn2:outgoing>sequenceFlow_smO8Aw</bpmn2:outgoing>
      <bpmn2:incoming>sequenceFlow_kIA1WQ</bpmn2:incoming>
    </bpmn2:userTask>
    <bpmn2:userTask id="task_R4hOYQ" name="Loved things">
      <bpmn2:documentation id="documentation_y3Lqng"/>      
      <bpmn2:incoming>sequenceFlow_smO8Aw</bpmn2:incoming>
      <bpmn2:outgoing>sequenceFlow_duTfMA</bpmn2:outgoing>
    </bpmn2:userTask>
    <bpmn2:endEvent id="event_XwSaig" name="End">
      <bpmn2:documentation id="documentation_koQzIA"/>
      <bpmn2:incoming>sequenceFlow_duTfMA</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:sequenceFlow id="sequenceFlow_0bWvHA" sourceRef="event_dcKl2g" targetRef="task_p9QtJg">
      <bpmn2:documentation id="documentation_JjeANg"/>
    </bpmn2:sequenceFlow>
    <bpmn2:sequenceFlow id="sequenceFlow_smO8Aw" sourceRef="task_p9QtJg" targetRef="task_R4hOYQ">
      <bpmn2:documentation id="documentation_5VlTHA"/>
    </bpmn2:sequenceFlow>
    <bpmn2:sequenceFlow id="sequenceFlow_duTfMA" sourceRef="task_R4hOYQ" targetRef="event_XwSaig">
      <bpmn2:documentation id="documentation_gqiqvw"/>
    </bpmn2:sequenceFlow>
    <bpmn2:receiveTask id="task_MPPyxg" name="Task-3" instantiate="true">
      <bpmn2:documentation id="documentation_qc8ghA"/>
      <bpmn2:outgoing>sequenceFlow_kIA1WQ</bpmn2:outgoing>
    </bpmn2:receiveTask>
    <bpmn2:sequenceFlow id="sequenceFlow_kIA1WQ" sourceRef="task_MPPyxg" targetRef="task_p9QtJg">
      <bpmn2:documentation id="documentation_LFztyg"/>
    </bpmn2:sequenceFlow>
  </bpmn2:process>
  <bpmn2:message id="message_4PfvrA" name="Message-1">
    <bpmn2:documentation id="documentation_THHSTw"/>
  </bpmn2:message>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1" name="OpenBPMN Diagram">
    <bpmndi:BPMNPlane bpmnElement="collaboration_1" id="BPMNPlane_1">
      <bpmndi:BPMNShape bpmnElement="participant_GbLEaw" id="BPMNShape_pvuu4A">
        <dc:Bounds height="310.0" width="830.0" x="480.0" y="280.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="event_dcKl2g" id="BPMNShape_oBpFFQ">
        <dc:Bounds height="36.0" width="36.0" x="557.0" y="427.0"/>
        <bpmndi:BPMNLabel id="BPMNLabel_k5YNIw">
          <dc:Bounds height="20.0" width="100.0" x="525.0" y="466.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="task_p9QtJg" id="BPMNShape_pKoMYQ">
        <dc:Bounds height="50.0" width="110.0" x="680.0" y="430.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="task_R4hOYQ" id="BPMNShape_pFxi3w">
        <dc:Bounds height="50.0" width="110.0" x="850.0" y="430.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="event_XwSaig" id="BPMNShape_ShDjWA">
        <dc:Bounds height="36.0" width="36.0" x="1107.0" y="367.0"/>
        <bpmndi:BPMNLabel id="BPMNLabel_2zuOLw">
          <dc:Bounds height="20.0" width="100.0" x="1075.0" y="406.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_0bWvHA" id="BPMNEdge_znZbJQ" sourceElement="BPMNShape_oBpFFQ" targetElement="BPMNShape_pKoMYQ">
        <di:waypoint x="593.0" y="445.0"/>
        <di:waypoint x="636.5" y="445.0"/>
        <di:waypoint x="636.5" y="455.0"/>
        <di:waypoint x="680.0" y="455.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_smO8Aw" id="BPMNEdge_Jddpyg" sourceElement="BPMNShape_pKoMYQ" targetElement="BPMNShape_pFxi3w">
        <di:waypoint x="790.0" y="455.0"/>
        <di:waypoint x="850.0" y="455.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_duTfMA" id="BPMNEdge_CX2z6A" sourceElement="BPMNShape_pFxi3w" targetElement="BPMNShape_ShDjWA">
        <di:waypoint x="960.0" y="455.0"/>
        <di:waypoint x="1033.5" y="455.0"/>
        <di:waypoint x="1033.5" y="385.0"/>
        <di:waypoint x="1107.0" y="385.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape bpmnElement="event_rpeOwg" id="BPMNShape_mnVenA">
        <dc:Bounds height="36.0" width="36.0" x="477.0" y="7.0"/>
        <bpmndi:BPMNLabel id="BPMNLabel_Eo00gQ">
          <dc:Bounds height="20.0" width="100.0" x="445.0" y="46.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="event_yxtfvw" id="BPMNShape_RuLtsA">
        <dc:Bounds height="36.0" width="36.0" x="817.0" y="7.0"/>
        <bpmndi:BPMNLabel id="BPMNLabel_ZkN5OQ">
          <dc:Bounds height="20.0" width="100.0" x="785.0" y="46.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_kERmaQ" id="BPMNEdge_WVFBIw" sourceElement="BPMNShape_mnVenA" targetElement="BPMNShape_UFu66Q">
        <di:waypoint x="513.0" y="25.0"/>
        <di:waypoint x="601.5" y="25.0"/>
        <di:waypoint x="601.5" y="135.0"/>
        <di:waypoint x="690.0" y="135.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape bpmnElement="task_MPPyxg" id="BPMNShape_CTmfzQ">
        <dc:Bounds height="50.0" width="110.0" x="590.0" y="310.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="message_4PfvrA" id="BPMNShape_OKyVyg">
        <dc:Bounds height="20.0" width="30.0" x="850.0" y="200.0"/>
        <bpmndi:BPMNLabel id="BPMNLabel_obYgxw">
          <dc:Bounds height="20.0" width="100.0" x="815.0" y="225.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="task_q8rRmw" id="BPMNShape_UFu66Q">
        <dc:Bounds height="50.0" width="110.0" x="690.0" y="110.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_4engnQ" id="BPMNEdge_3Mg1cg" sourceElement="BPMNShape_UFu66Q" targetElement="BPMNShape_RuLtsA">
        <di:waypoint x="745.0" y="110.0"/>
        <di:waypoint x="745.0" y="76.5"/>
        <di:waypoint x="835.0" y="76.5"/>
        <di:waypoint x="835.0" y="43.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="messageFlow_OMPswg" id="BPMNEdge_qzio7w" sourceElement="BPMNShape_UFu66Q" targetElement="BPMNShape_OKyVyg">
        <di:waypoint x="800.0" y="135.0"/>
        <di:waypoint x="865.0" y="135.0"/>
        <di:waypoint x="865.0" y="200.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="messageFlow_oBGang" id="BPMNEdge_3KHv0g" sourceElement="BPMNShape_OKyVyg" targetElement="BPMNShape_CTmfzQ">
        <di:waypoint x="850.0" y="211.0"/>
        <di:waypoint x="640.0" y="211.0"/>
        <di:waypoint x="640.0" y="310.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_kIA1WQ" id="BPMNEdge_5NpCgA" sourceElement="BPMNShape_CTmfzQ" targetElement="BPMNShape_pKoMYQ">
        <di:waypoint x="645.0" y="360.0"/>
        <di:waypoint x="645.0" y="395.0"/>
        <di:waypoint x="735.0" y="395.0"/>
        <di:waypoint x="735.0" y="430.0"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>
@rsoika
Copy link
Member

rsoika commented Jun 17, 2024

Hi @paule96 , thanks for your feedback. Yes it looks you are right. We need to improve the validation algorithm in this point.
I think we can fix this within the next release.

@rsoika rsoika added bug Something isn't working enhancement New feature or request Server labels Jun 17, 2024
@rsoika rsoika added this to the 1.2.1 milestone Jun 17, 2024
@paule96
Copy link
Author

paule96 commented Jun 17, 2024

@rsoika thanks for the fast feedback :) Let me know if I can help

rsoika added a commit that referenced this issue Jun 17, 2024
rsoika added a commit that referenced this issue Jun 17, 2024
@rsoika
Copy link
Member

rsoika commented Jun 17, 2024

@paule96 I think I have fixed this issue. Maybe you can have a short look at the new validation method:

public List<BPMNValidationMarker> validate() {

I don't know the specification by heart, but do you think there is a similar case for outgoing message flows on a Task Element? I still validate that we have at least one outgoing sequence flow - which should be correct for my understanding....?

Here is the code for the new unit test:

I used you model as a reference model in this test.

@rsoika
Copy link
Member

rsoika commented Jun 17, 2024

Method validateProcess need to be improved. In case of a message flow connection between two tasks, the current impl does not work correctly. (But this is a GLSP client problem)

@paule96
Copy link
Author

paule96 commented Jun 18, 2024

As far as I understand the code should be valid. (I'm also not so deep into the BPMN spec)
But my sample from yesterday may not be precise.
As far as I understand a Message can only be "connected" to a message flow, but can't be the target or source of one.
Because if you look into the XSD of BPMN a Message flow has only a MessageRef. And the Message it self is a RootElement.
So maybe we should remove from the XML the test is using the Message object and just make a direct connection between SendTask and the ReceiveTask. Because currently, I'm unsure how to define/use messages in BPMN.

So it would be good if the validation method stays like that. (both sides should be an activity)
But I'm also not to 100% sure

@rsoika
Copy link
Member

rsoika commented Jun 18, 2024

Ok, thanks for your feedback. We can leave it like it is for now. The validation method is very new and currently covers only some cases. I think we can improve the validation step by step in the future.

Thanks again for your valuable feedback!!

I will prepare a new VS-Code Extension update soon.

@paule96
Copy link
Author

paule96 commented Jun 21, 2024

image

For now it is working 🥳
Thank you for the for the quick fix @rsoika.
But yes I agree that the topics messageflows and messages need to be improved and understood more over time.

Do we want to close this issue and make a new one for handling messages and message flows in general?
Or does this issue keeps track of the issue?

@rsoika
Copy link
Member

rsoika commented Jun 21, 2024

Hi @paule96
yes lets close this one. More smaller issues gives better the feeling of making progress instead of working endless on one big issue ;-)

One background note to the project structure:
The validation is completely covered by the module open-bpmn.metamodel. This module is plain java and completely independent form the GLSP UI framework. The goal is to make this module usable for other projects like workflow engines too. For example we plan to integrate this module in imixs-workflow to improve the processing logic.
Regarding the validation, I try to cover each case with a junit test and a reference model. But as mentioned before there are only a few rules implemented. It was more a prove of concept how to integrate this into the glsp framework.
GLSP uses a concept of a live and a batch validation and this leads to the concept in open-bpmn to bind the validation to each element - so each node is responsible to answer its own validation state. The model instance simpliy iterates over all elements and collects validation errors.

@rsoika rsoika closed this as completed Jun 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 enhancement New feature or request Server
Projects
None yet
Development

No branches or pull requests

2 participants