JBDC Provisioning Rule

Hi Everyone,

I am working on JDBC Provisioning Rule. I have incorporated an Stored Function in the create operation, but I see few attributes are missing in it. Hence I have doubt that can I added insert/update query for the missing attributes??

Please find the below code which I am referring for.

if ( AccountRequest.Operation.Create.equals( account.getOperation() ) ) {
 
	    			 
	    			  statement = connection.prepareStatement("SELECT oper_id FROM XTPFILDBO.T_TKOP_OPER_PROFILE where oper_id = ?" );
 
	    			  statement.setString ( 1, oper_id );
 
	    			  ResultSet resultQ = statement.executeQuery();
 
	    			  if(!resultQ.next()) {
                          log.error("Inside stored statement statement--------------:" );
	    				
                          CallableStatement cs = connection.prepareCall("begin dbms_output.put_line(XTPFILDBO.pkg_dev_util.CREATE_OPERATOR_NONADMIN(?,?,?,?,?,?,?)); end;");
		    			  
						
						  cs.setString ( 1, oper_id);
		    			          cs.setString ( 2, first_name);
                                                  cs.setString ( 3 , last_name);
						  cs.setString ( 4, ent);
						  cs.setString ( 5 , org);
						  cs.setString ( 6 , creOper);
						  cs.setString ( 7 , comments);
		    			          log.error("before excute");
						  cs.execute();
						  log.error("After excute");
 
		    	       
	    			  }
 
	    		      result.setStatus( ProvisioningResult.STATUS_COMMITTED );
 
 
	              }

If we can achieve it, requesting to share the reference code snippet.

Kind Regards,
Sai Krishna L

Hey @sai_krishna_L ,

Have you referenced the missing attributes in the create provisioning policy and have a reference to those attributes value wither via identity profile attributes or transforms or cloud rule?

If not maybe that way you have the values for the missing attributes and additionally the reference document here:
JDBC Provision Rule | SailPoint Developer Community

Has the information of what objects are available for your use directly in the rule

And for your query of inserting ad-hoc insert/update query yes you can but again please try the above suggested way and then if it does not work have the insert queries.

Thanks,
Aman

If you put a logger in place, are you able to see all the values?
Also, confirm if the values you are trying to use in the Connector rule are being sent to the plan!
Reason being unlike Cloud rule you cannot access any identity attribute. You can only access the attributes that are sent on the plan.
So, Make sure for the user you are testing it, has all these values populated.

Moreover, navigate to search->search for the test user-> Account activity-> open the request which has been triggered for the JDBC source.
Verify that Attribute request has all the values that you needed in the connector rule. I.e all these 7 attributes should have a value or included in the plan.

Hope this helps…

Hi @neeraj99 & @amansingh

Thanks for your response.

I have achieved the problem statement using multiple prepared statement and added the required SQL statements for the same.

Kind Regards,
Sai Krishna L

2 Likes

You have to create provisioning policy for that Application if you want to send attributes in your provisioning plan. Here is a link to create provisioning Policy. create-provisioning-policy | SailPoint Developer Community

Once you have policy setup, you can decide in provisioning policy what values you are going to send in the plan. You can either send identity attribute or account attribute. Once you have that ready, you can fetch value/attributes in plan.

For example, to fetch ‘first’ attribute that you send in plan, you can retrieve as follows:

getAttributeRequestValue(account,"first")

  public String getAttributeRequestValue(AccountRequest acctReq, String attribute) {

    if ( acctReq != null ) {
      AttributeRequest attrReq = acctReq.getAttributeRequest(attribute);
      if ( attrReq != null ) {
        return attrReq.getValue();
      }
    }
    return null;
  }

Hope this helps.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.