Which IIQ version are you inquiring about?
8.3
Share all details about your problem, including any error messages you may have received.
I’m currently developing a pre-aggregation processing rule as part of a Rule Development Kit (RDK) project in IntelliJ and I’m running into serious challenges when simulating IdentityIQ context and custom objects for local testing.
My Goal
Scenario: I want to simulate a delimited file connector (an HR feed file) to validate my logic before moving the rule into the real IdentityIQ environment.
Production Reality: In actual IdentityIQ, this rule would reference a custom object (an XML) for parameters (e.g., email template, file paths, etc.). The engine automatically injects context
so I can do something like:
Custom customObject = context.getObjectByName(Custom.class, “Custom-Source-Application-Configuration”);
Local Testing in IntelliJ (RDK): For simpler helper methods that don’t need context
, I’ve succeeded in writing JUnit tests where I create a Beanshell Interpreter
, do interpreter.set("someVar", value)
, then call the function. Those tests work fine.
Where I’m Stuck
As soon as I try to test any logic that needs context
(for example, calling context.getObjectByName(...)
to retrieve a custom object), I get NullPointerExceptions or BeanShell parse errors in my local environment. I tried:
- Dummy Context & Custom Classes
- I wrote a
DummyContext
that implements something like:
public Object getObjectByName(Class clazz, String name) {
// return a dummy Custom object
}
- Also wrote a dummy
Custom
class,Attribute
class, etc. - Despite that, top-level rule code still throws an error if it references
config.get("app")
or tries to runcontext.getObjectByName(...)
at load time.
Basically, I can’t replicate IdentityIQ’s injection of context and custom objects reliably in my IntelliJ + Beanshell setup. The rule development kit approach, as I understand, is to create a test method for each piece of logic, create a Beanshell Interpreter
, set variables, then eval(...)
the rule code. But the moment I reference production-like code that expects context
or a real custom object, it fails.
Key Details & Questions
- RDK Best Practices: Is there a known pattern or recommended approach for testing logic that references custom objects?
- Dummy Object Setup: If I continue with the RDK in IntelliJ, how do I correctly inject the dummy context so that code like
context.getObjectByName(...)
works without a NullPointer? I’ve tried scripts that defineclass DummyContext implements Context { ... }
and instantiatecontext = new DummyContext()
. But top-level code in the rule still fails if it referencesconfig
orcontext
too early.
Is it suggested to just code within the sailpoint console instead and test iteratively through the debug browser, basically i can use the rdk to do coding for convenience where i see the functions come up with intelliJ snese, like when typing Identity, etc but really just do the testing inthe object browser itself? i was really liking the vibe of the RDK, but it has been too much of a nuisance to get it to work.
Thank you so much—I really appreciate any guidance. I’m new to Sailpoint, and the RDK approach, but I’d love to keep using it if there’s a known pattern for dealing with context
references.
Thanks in advance!