In OIC runtime, integration flows are identified by a unique id, the instance id. This is defined in the OIC Gen2 and OIC3 api as a string -
In OIC Gen2 - this string contains a numeric value -In OIC3 this instance id string is alphanumeric -
Storing Instance Id in a DB
Some OIC Gen2 customers have stored the instance id in a DB table, sometimes for compliance purposes, also to enable lookups of instance state by other integrations e.g. Integration B checks on the state of Integration A via the OIC Factory apis.
Check out my simple DB table below -many customers have defined the column holding the instance id as NUMBER, when they really should have been using VARCHAR.
This could be fed by a common integration, such as the following -
I use the Oracle DB adapter -This means I will need to change the DB column type -
So, in this case, let's do a backup of the table -
However, when the table is empty, you could also use the ALTER Table command to change the column datatype, e.g. ALTER Table oic_instance_flows modify (instanceid varchar2(30));
Remember the instance id value in OIC3 is 22 characters.
I now execute the integration the writes to the DB table -
This error requires me to edit the integration. First thing I do is change the REST trigger request from -
Now I am upgrade to OIC3, so I need to do the following -
2. Edit the PLSQL Stored Procedure -
3. change the REST trigger request, setting instanceid as string.
Summa summarum, OIC developers leveraging such will probably have just 1 integration that inserts the instance id into the database. This common integration will be invoked by the other integrations. So the actual amount of work involved in refactoring this should be minimal.
you will need to validate the usage of these in your integrations to see what you are doing with these.
Next step is to restore the data from the backup table -
SQL> insert into oic_instance_flows (instanceid, integrationname, rundatetime) select instanceid, integrationname,rundatetime from oic_instance_flows_backup;
This error requires me to edit the integration. First thing I do is change the REST trigger request from -
{
"instanceId" : 123456,
"integrationName" : "ABC"
}
to
{
"instanceId" : "ABC123456",
"integrationName" : "ABC"
}
Now to the DB invoke - the quickest method is to delete this and recreate it.
Here we import the new definition of the table i.e. with instanceid as VARCHAR2.
Here's an example based on a stored procedure -
Now I am upgrade to OIC3, so I need to do the following -
1. change the DB column to VARCHAR2
{
"instanceId" : "ABC123456",
"integrationName" : "ABC"
}
4. Re-create the DB invoke of the Stored Procedure -
Using OIC getFlowId Function
The instance id could also be retrieved via the following and used in the mapper -
The function could also be used in an Assign action -
No comments:
Post a Comment