I am trying to gather more data from integrated application but that operation requires custom code.
The question is the following:
Have you ever encountered an issue where the connector class was not available despite having required imports? (Causing typed variable declaration class not found in namespace error)
How did you solve it?
We noticed that the same piece of code with same imports is working when run from Before provisioning rule, but not from customization rule.
@blazejbadzio Connector object might not be available as available argument but you should be able to load. could you please share your rule to review to see if anything missed over there?
Sure. That code is actually sufficient to cause an error.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule language="beanshell" name="TEST_Customization_Rule" type="ResourceObjectCustomization">
<Description>This rule is configured on the application and is called after the connector has build a ResourceObject from the native application data.
Initially designed for non-rule based connectors to add SPPrivileged flag to an object, but could be used to do any transformations.</Description>
<Signature returnType="ResourceObject">
<Inputs>
<Argument name="log" type="org.apache.commons.logging.Log">
<Description>
The log object associated with the SailPointContext.
</Description>
</Argument>
<Argument name="context" type="sailpoint.api.SailPointContext">
<Description>
A sailpoint.api.SailPointContext object that can be used to query the database if necessary.
</Description>
</Argument>
<Argument name="object">
<Description>
The ResourceObject built by the connector.
</Description>
</Argument>
<Argument name="application">
<Description>
Application that references the connector.
</Description>
</Argument>
<Argument name="connector">
<Description>
The connector object.
</Description>
</Argument>
<Argument name="state">
<Description>
A Map containing state information.
</Description>
</Argument>
</Inputs>
<Returns>
<Argument name="resourceObject">
<Description>
The updated resource object.
</Description>
</Argument>
</Returns>
</Signature>
<Source>
import sailpoint.object.Application;
import sailpoint.connector.successfactors.*;
import sailpoint.connector.SuccessFactorsConnector;
import sailpoint.connector.successfactors.odata.SuccessFactorsRestAuthProvider;
Application sfApp = context.getObjectByName(Application.class, "appName");
sailpoint.connector.SuccessFactorsConnector successFactorsConnector = new sailpoint.connector.SuccessFactorsConnector(application);
return object;
</Source>
</Rule>
The code won’t work past the declaration of successFactorsConnector variable.
With error: