JDBC provisioning to different table

I have a working rule for disable, enable but have an issue with create. I am not able to write to the original source table so have created another table (middleware) where the application is listening for any changes and then imports them into the application using a defined field map. The problem is that the original table field names are text1 thru text25, date1 thru dateN, int1 thru intN, ext… I would like to use more descriptive names in the middleware table.

My question is there an easy way use different field names and still use attribute sync? I’m not finding a way other than add them to the original table schema which allows me to select them for attribute sync. Seems overkill (too much)! Any suggestions?

Hi Kelvin,

What do you have in your create account profile? Is it mapping attributes to the primary attributes, or to the text1 - text25 attributes?

If it were me, I think I would still map it as though I were directly updating the primary attributes, but in the BeanShell, I would map the update statement to the middleware table, there mapping the primary attributes to their respective fields.

Something like this:

statement = connection.prepareStatement( \"insert into middleware (text1,text2,text3) values (?,?,?)\" );
statement.setString ( 1, (String) account.getNativeIdentity() );
statement.setString ( 2, getAttributeRequestValue(account,\"last_name\") );
statement.setString ( 3, getAttributeRequestValue(account,\"first_name\") );
statement.executeUpdate();
  
result.setStatus( ProvisioningResult.STATUS_COMMITTED );

Perhaps I’ve missed the exact details of your tables, but I hope that gets the idea across, and that it’s a help.

Matt

1 Like

In the application they give the attribute a display name that shows in the UI so they don’t see the text, int, date field names. The import job also shows the display names for the application but shows the actual middleware table field name. If I use the text names in middleware it isn’t clear to the application users what text1 from the middleware table really is. Only shows the name and no example data either. I’ll end up redoing the middleware table and the import job since we started with disable feature and it wasn’t an issue. Then provide a mapping layout for the application users for them to always refer to.

Hi @kwhipple you could try using the internalName attribute in the schema definition.

eg:

<Schema...>
  <AttributeDefinition internalName="text1" name="givenName" type="string"/>
</Schema>

It’s not well documented.