Hi All,
I am working on the JDBC provisioning rule. I have an attribute called “UID” which is set as Account ID and Account Name and it gets generated when a new account is created in the database. I am able to create the account successfully but when I look into the accounts it is showing ??? on the account Link in IDN.(I can see the ??? getting replaced with the UID when I aggregated the source) I have configured the single account aggregation query as well (Select * from table where UID = ‘$(identity)’). I think it showing ??? in the link because UID is getting generated at the time of account creation in DB and it is not able to aggregate that account.
Is there a way to read that generated value for UID and aggregate that account so that it won’t show ??? on the link in IDN?
Here is my JDBC provisioning rule
public String getAttributeRequestValue(AccountRequest acctReq, String attribute) {
if ( acctReq != null ) {
AttributeRequest attrReq = acctReq.getAttributeRequest(attribute);
if ( attrReq != null ) {
return attrReq.getValue();
}
}
return null;
}
ProvisioningResult result = new ProvisioningResult();
PreparedStatement statement;
if ( plan != null ) {
List accounts = plan.getAccountRequests();
if ( ( accounts != null ) && ( accounts.size() > 0 ) ) {
for ( AccountRequest account : accounts ) {
try {
if ( AccountRequest.Operation.Create.equals( account.getOperation() ) ) {
statement = connection.prepareStatement( "insert into table (prefferedFirstName,lastName,accessCode,active,email) values (?,?,?,?,?)" );
statement.setString ( 1, getAttributeRequestValue(account,"prefferedFirstName") );
statement.setString ( 2, getAttributeRequestValue(account,"lastName") );
statement.setString ( 3, getAttributeRequestValue(account,"accessCode") );
statement.setString ( 4, getAttributeRequestValue(account,"active") );
statement.setString ( 5, getAttributeRequestValue(account,"email") );
statement.executeUpdate();
result.setStatus( ProvisioningResult.STATUS_COMMITTED );
} else if ( AccountRequest.Operation.Modify.equals( account.getOperation() ) ) {
// Modify Operation
}
}
catch( SQLException e ) {
result.setStatus( ProvisioningResult.STATUS_FAILED );
result.addError( e );
}
finally {
if(statement != null) {
log.error("------");
}
}
}
}
}
return result;
Thanks,
Subash