Introduction
Now I will look at implementing a more complete solution, using the factory api.
The following api call copies the integration to a project -
POST - https://design.integration.us-phoenix-1.ocp.oraclecloud.com/ic/api/integration/v1/projects/myProject/integrations/copy?integrationInstance=myOICInstance
Note the request payload -
I check my new project -
ERP_GETORDER is still present in the global space. In the meantime, I've activated the ERP_CreateOrder integration.
This will set the status accordingly.
I copy this integration to the project -
Excellent! My ERP integrations are in my ERP Project. But wait a minute, they're still in the global space. I need to delete them form there, this is, after all, a move.
Activated integrations cannot be deleted, so I need to check the status field, shown above.
If status = ACTIVATED then I need to deactivate -
For this I use the following api -
Here I need the id field from the GET Integrations response.
https://design.integration.us-phoenix-1.ocp.oraclecloud.com/ic/api/integration/v1/integrations/ERP_CREATEORDER|01.00.0000?integrationInstance=myOICInstance
Now to deletion, here I use -
https://design.integration.us-phoenix-1.ocp.oraclecloud.com/ic/api/integration/v1/integrations/ERP_CREATEORDER|01.00.0000?integrationInstance=myOICInstance
ERP_CREATEORDER Integration is deleted -
Finally, let's build a UI around this; starting point is the following OIC Project -
Get Integrations: retrieves a list of integrations, based on a filter -
I invoke this from a simple VB app -
Back to OIC, the next integration we'll look at is Move Integrations. This integration does the following - For the integrations list received, iterate over each integration, invoking the 3rd integration, Copy Integration, which copies the integration to the target project specified in the VB app. It then checks whether the integration status = ACTIVATED; if this is the case, the integration is deactivated. Finally, the integration is deleted from the global space.
I will now show you how to add the endpoint of Move Integrations to the VB Service Connection.
That's it - simple stuff!

No comments:
Post a Comment