-
Notifications
You must be signed in to change notification settings - Fork 638
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
IllegalStateException when writing decision evaluation event #9272
Comments
My hypotheses on what happens:
It is a bit of a strange situation which occurs when there are multiple decisions containing the same id. I see a couple of solutions here:
|
Marked as mid severity as it is an edge-case that's easily resolvable if it does occur. |
Nice work figuring out what happened @remcowesterhoud 🎉 I really like it
I don't think it's unpredictable behavior. We wanted it to evaluate the latest deployed version of the decision with the decision id. Similar to call activity that starts an instance of the latest deployed process with the process id. I understand that these are somewhat different because the decision is inside another layer (the DRG), but I think that keeping the behavior aligned between processes and decisions keeps things the easiest to understand for users. In addition, we should not reject DRGs with decision ids that are already in use, because it allows a user to replace the existing decision which might be useful while we don't have undeploy decision api.
Again, I would align with Process deployments. Please correct me if I'm wrong, but I think deploying a process a second time with some differences leads to the same key with a different version.
I think we should do this as it fixes the problem without changing the key and version logic 👍 |
No. The key of a process is unique. A new version of the process gets a new key. |
@saig0 Would you prefer option 2 over option 3 in this case? |
Yes. I prefer to generate a new key and increase the version of the DRG if the version of one of the containing decisions is increased. |
Describe the bug
When trying to write the decision evaluation event an
IllegalArgumentException
is thrown. This is because when searching for decision by decision requirements key multiple results with the same decision id are returned:These duplicate decision id cause the
toMap
function to fail, as no merge function is provided.The found decisions do all have a different version.
To Reproduce
It was a challenge to reproduce this issue but I found a way to do this. It requires 2 DRD's that both contain a decision with the same id and a process which contains a business rule task referencing this decision id.
Repro files.zip
Next follow these steps:
translateDay.dmn
translateMonth.dmn
translateDay.dmn
translateProcess.dmn
zbctl create instance translateProcess --insecure --variables '{"day":"monday","month":"april"}'
At this point an exception should be thrown.
Expected behavior
No exception should occur.
Log/Stacktrace
Full Stacktrace
Environment:
The text was updated successfully, but these errors were encountered: