Im working in a rule, with this rule I want to achive to predelagate some record’s in a certificacion, I mean if one of my record’s certification belongs to the workgroups “Executive Workgroups“ this one need has to be delegation for the workgroup “SAC TEAM“. Here is mi current rule, and I set on the Pre-delegation rule for a manager certification type, the certification is already stagin period, I have 2 doubts
The rule starting to work when the certification is already active?, In my rule I Misisng something due to I dont see the SAC TEAM on the column certifier’s ?
You are on the right track with your rule logic, but I can help clarify a few things and suggest improvements.
To answer your questions:
Does the rule work if the certification is already active?
No — pre-delegation rules only apply during the staging phase of a certification. If the certification is already active, the rule won’t retroactively apply. You’d need to either:
Revert the certification to staging (if possible), or
Apply delegation manually or via a different mechanism.
Why don’t you see the SAC TEAM in the certifier column?
A few possibilities:
The getOwner() method might not be returning the expected identity (e.g., a user instead of a workgroup).
The name comparison might be failing due to formatting or case sensitivity.
The rule might not be triggered at all if the condition isn’t met.
I made the next update to the rule. but Im still face off the same problem, if I not wrong this instruction resultado.put(“reassign”,Boolean.TRUE); reassign to the workgroup “TEST_BA“, but I dont see the workgroup TEST_BA on the column Certifiers
Thanks for the suggestion, I made the update on the rule but I noticed one thing is not working from the begin, is failing on the second “if”, due to on my log’s go to the final “else“ I need to understand with this instrucction what I reading, the record’s of the list one by one on the column certifier or all of it what I have inside of each record? this is my output log
CertificationEntity ce = (CertificationEntity)entity;
Thanks for the update! Based on your logs, the rule is failing at this line:
CertificationEntity ce = (CertificationEntity) entity;
The issue is that ce.getOwner() is returning null, which means the certifier isn’t being retrieved correctly. This usually happens if the certifier is a workgroup and not an Identity.
To fix this, try checking the type before casting:
Object owner = ce.getOwner();
if (owner instanceof Identity) {
Identity duenoActual = (Identity) owner;
// continue with your logic
} else {
customLog.debug("Owner is not an Identity: " + owner.getClass().getName());
}
You’re getting a NullPointerException at runtime because the rule is trying to invoke a method on a null object. Specifically, cause:
Object owner = ce.getOwner();
if ce is null , or ce.getOwner() returns null , any method call on it (like getName() or casting) will throw this exception.
Add null checks before using the object. Here’s a safe version of the logic:
CertificationEntity ce = (CertificationEntity) entity;
if (ce != null) {
Object owner = ce.getOwner();
if (owner instanceof Identity) {
Identity duenoActual = (Identity) owner;
// continue with your logic
} else {
customLog.debug("Owner is not an Identity or is null");
}
} else {
customLog.debug("CertificationEntity is null");
}
I made the update as you say, but I still have the null pointerexception in the run time , I did another idea, but is the same issue, I know the reason is not working due to the ce is a null value, but when I run I dont know why doesn’t enter on the next instruction “certificationentity is null“ or the instruction “the certification has not items“
I updated the code, but two thing’s I dont understand I have miss match type class exception, due to on the argument’s I can pass String data, and my other doubt is why you set a List at the beginning? I mean could I use this function getCerfiers() instead entity , this is my code and my exception
Could you please update the following line in your code:
resultado.put(“recipientName”, baIdentity);
to:
resultado.put(“recipientName”, baWorkGroup);
The reason for this change is that recipientName expects a value of type String, but currently you’re passing an Identity type. To ensure type compatibility and avoid potential runtime issues, it should be updated to a String.
Finally work’s, I really appreaciate your support and the suggestion´s in wich to updated the rule. the rule is forwarding to the TEST_BA workgroup, just I have another doubt why in the next line I couldn’t pass an Identityobject? and just only java datatype such as String, int, boolean, etc.