-
Notifications
You must be signed in to change notification settings - Fork 565
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
A workflow with start event message will deploy but fail to start if it has an event sub process #4099
Comments
@allanbarklie, thank you for reporting 👍 I can reproduce the behavior with the given workflow. The variables are not created (i.e. no variable records are present). So, an incident is raising when try to open the message subscription. |
@saig0 Should we clone this issue so that the Operate team can look at what is happening on their side? If this issue it fixed, it might hide the behavior of Operate again. |
Good point 👍 |
Summary of analysis results: The error occurs, because the variables are transferred into the state after the subscriptions are created. The bug is valid, but there is no immediately obvious fix to this. The sequence of events is as follows:
If it wouldn't fail, it would proceed as follows:
The variables would be copied during the completion of the start event (either in COMPLETING or COMPLETED stage). This happens at this time, because there might be input/output mappings for the start event. The workflow scope should only be filled with variables, after input/output mapping has been applied to the message. The correlation key expression in the message on the event sub process should work in a scope after input/output mapping of the start event has been applied. There is no obvious fix, because several constraints are in conflict here:
We decided to not proceed with the bugfix at this moment. |
Regarding the related issue for the Operate team:
|
@pihme Thanks for looking into this. From your analysis can you confirm if my above workaround (using an extra sub process) is safe/guaranteed to work? Would there be anything about how that works that might help inspire a fix? |
tldr; I can confirm your workaround is safe. Long version: First a little caveat, I joined the Zeebe team two months ago. So I am by no means an expert of BPMN, or Zeebe. To the best of my knowledge, your work around is safe to work. It displays a good separation of concerns in the sense, that there is one message to start the process and another message to trigger the event sub process. This makes intuitive sense to me, and I can see how this can be used in practical projects. Also, by moving the event sub process into a dedicated sub process, you avoid any ambiguities about the precise sequencing of steps when the process is instantiated. I yet have to understand the practical application of the process for which you filed this bug report. What is the use case where the very same message should create a process and be processed by one of the newly created processes' event sub process? The fact, that I cannot imagine such a use case is not meant to be derogatory. Instead, it is my lack of experience and also my curiosity. In particular, if there is a concrete use case, it would be great to know about it. Not least, because I have a sense that this specific constellation is perhaps not sufficiently detailed spec-wise - so knowing about user's expectation could weigh in when looking for solutions. Whether your work around will inspire a more general solution, I can only speculate about this. It is conceivable that we implicitly add a sub process on the fly. However, the behavior would change in subtle ways if we do so. And I still need to learn more about what the BPMN spec mandates, and where we have wiggle room. My only caution about adopting this strategy today, is that I don't know if the work around can be generalized. Workflows can have several start events, and different types of start events. I am not sure whether this work around works for the general case. On the flip side, the problem you found is a general one. Like, you could also draw a process with a message start event and a timer based event sub process, with FEEL expressions to configure the timer. I haven't tested it, but it should run into the same issue you reported. So nice catch! |
@pihme I'd like to explain my use case to help you understand/judge the validity/severity of the defect. One clarification to start with - the detail in the file correlationIssue.bpmn.txt where both the main and sub process start messages have the same name and ID was not intended. Sorry for that. The defect can also be observed where the main and sub process have different names and IDs. My use case expects different ones. The use case is one where the sub process actually starts a call activity that defines some other workflow. Looking at this again I now realise that the same pattern can be achieved by simply using two parallel gateways one at the beginning and one at the end.
I think the only difference is clutter on the diagram (not obvious in the simplified versions here). |
@allanbarklie I am just going to quickly react to some keywords I read in your description:
Anyway, I will shut up now. As much fun as it is to talk to a user of our software, there are people better qualified than me to accompany you on your learning journey. In particular, I can recommend
Both are free and we have moderators/DevRel specialists for each. Feel free to check it out! |
@npepinpe no, this is a different problem. Here, we're not able to handle a workflow with a message start event and a message event subprocess. |
Added support label for: https://jira.camunda.com/browse/SUPPORT-12762 |
author: Philipp Ossler The subscriptions will now be opened after the output mappings of the start event have been applied. This is in line with user expectations and fixes issue #4099
9047: Fix 4099 by opening event subscriptions after start event's output mappings were applied r=pihme a=pihme ## Description This moves the step when event subscriptions are opened from `ProcessProcessor` and `SubprocessProcessor` to `StartEventProcessor`. This way, subscriptions and the values used for them will only be evaluated after output mappings of the start event have been applied. This fits better to user expectations and fixes #4099 ## Related issues closes #4099 Co-authored-by: pihme <pihme@users.noreply.github.com>
Migrating to 8.1.X required to have this bugfix which is required: camunda/camunda#4099
Describe the bug
A workflow that is started with a start event message will deploy but fail to start if it has an event sub process (this is not the same as the deploy time issue caused by the modeller leaving out correlationkey ).
Variables added to the process start message don't seem to visible when the broker tries to subscribe the event sub process to its start message so it it complains it can't see the correlation key (it looks for the right variable but can't find it).
This also sometimes causes the operate UI to get in bad state where it always reports the incident but can't always show the instance details.
Workaround: Placing the event subprocess within a wrapping subprocess fixes the issue.
To Reproduce
Steps to reproduce the behavior (using attached files)
zbctl --insecure deploy correlationIssue.bpmn
zbctl --insecure deploy correlationIssueWorkaround.bpmn
(escape as needed for your shell)
zbctl --insecure publish message myStartMessage --variables '{"orderID":123}' --correlationKey 123
observe behaviour in operate UI
Process_CorrelationIssue fails with an incident (operate may or may not let you inspect it)
Process_CorrelationIssueWorkaround successfully starts
Expected behavior
both workflows start without error
Log/Stacktrace
Process_CorrelationIssue Failed to extract the correlation-key by 'orderID': no value found
Environment:
Related Support Case: SUPPORT-12762
correlationIssue.bpmn.txt
![issue](https://user-images.githubusercontent.com/42612310/77184714-15cd4900-6ac8-11ea-8b9d-06f1fffb6f7f.PNG)
correlationIssueWorkaround.bpmn.txt
![workaround](https://user-images.githubusercontent.com/42612310/77184716-1665df80-6ac8-11ea-8056-2e9269ce7f13.PNG)
The text was updated successfully, but these errors were encountered: