[midPoint] weird little bug with activiti / workflow / approvals

pdbogen at cernu.us pdbogen at cernu.us
Thu Sep 22 00:03:49 CEST 2016


Hi!

This is a strange bug report, and once you read it hopefully you'll understand 
why I didn't immediately open a ticket. (tl;dr: I encountered it, but I can't 
figure out how to reproduce it.)

While fine-tuning my approval workflows, I ran across a situation wherein 
approving a work item failed.

I apologize that I've now lost the full stack trace, but I tracked the error 
down to this line:

    https://github.com/Evolveum/midpoint/blob/master/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/itemApproval/ApprovalLevelImpl.java#L123

I'm not sure why, and so I cannot now reproduce, but sometimes the 
PrismContext for the deserialized approverExpression is null. In such a case, 
getValue throws an exception; and long story short, the approval of the work 
item fails.

While the problem was occuring, I was able to fix it by copying the code from 
just below, 
https://github.com/Evolveum/midpoint/blob/master/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/itemApproval/ApprovalLevelImpl.java#L142, 
which checks for a null PrismContext for automaticallyApproved and sets it if 
it is null.

I guess therefore this is a known problem, but an oversight that this check 
was not also done for the approverExpressions.

I've attached a simple patch that adds this check in, which fixed the problem 
for me. But, as mentioned, I don't know how to reproduce it..

Thanks!
-- 
             .
Patrick Bogen .
            ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bugfix.patch
Type: text/x-diff
Size: 1100 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20160921/c6b24c32/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20160921/c6b24c32/attachment.sig>


More information about the midPoint mailing list