I am seeing a strange behaviour with one of my rules, and it seems related to a referenced rule being referenced by another rule.
Situation:
I have 3 rules: A, B, C.
A imports C
B imports A and C
When I unit-test by running a method in A that calls method “cMethod” in C, everything works well.
When the code is executed through the actual flow though, rule B is called first, and when rule A is called it cannot find cMethod.
Has anyone seeing a similar behavior?
In the worst case scenario I will duplicate the code and remove the import from A to C, but I would like to avoid this.
Thanks in advance.
Updated:
I have now this setting:
A imports C
B imports C
Is there a chance there multiple methods with same methodName or any classes it imports from.
For example, we had sailpoint.connectorDependencies.EndPoint in the reference rule and sailpoint.connector.webservices.EndPoint in the Rule, As a result the rule was not able to find the method.
Referenced rules don’t cascade. Each rule needs to reference all of the rule libraries it needs, rather than relying on nested includes. That doesn’t explain why your B, which is including both A and C, can’t see cMethod.
Have you restarted your appservers since updating your rule library to include (or change the signature of) cMethod? The Beanshell global variables, which includes rule library methods, can be cached oddly in the BSFManager.
Thanks @drosenbauer , I usually reset the configuration cache when I see things are funny with rules (my sbx has only 1 server), and that usually sorts things out. This was not the case in this instance.
As the code is located in different Git branches I’ll merge them all in one and check again if there’s any method whose signature is present in one of the other rules, as suggested by you and @Jarin_James .
I will keep you guys posted (might take a couple of weeks as we are using the workaround and this has now dropped in priority).
Thanks for your help.