Usecase: We have a requiremwnt that we will create a reusable integration which will take input as lookup name and base64 encoded csv content and update or replace the OIC lookup based on that CSV file.
Logic steps:
- Create 2 connections
- Rest trigger connection
- OIC Rest invoke connection for oic lookup update rest api call
- Create an app driven orchestration style
- Configure rest trigger with the following:
- Request:
- Base64 encoded csv content
- Lookup name
- Response:
- jobStatus
- Exception code, reasona and details
- Assign globals
- Content: decodeBase64ToReference(base64StreamRef)
- Exception code, reason, details and result variables
- Take a scope and drag and drop created oic rest invoke connection and configure to update the lookup
- Api: /ic/api/integration/v1/lookups/archive
- Verb: Put
- Request: Multipart/form-data
- Response: binary , other media type: application/json; charset=utf-8
- Map the following:
- AttatchmentReference : content
- contentType: applocation/octet-stream
- partName: lookupname + ".csv"
- fileInputHtmlFieldName : file
- Go to default fault handler and assign the scope fault details and result as "UPDATE_ERROR"
- Assign the final response.
Rest trigger Request json:
{
"base64StreamRef":"ref",
"lookupName":""
}
Rest trigger Response Json:
{
"jobStatus":"",
"jobMessage":"",
"exceptionCode":"",
"exceptionReason":"",
"exceptionDetails":""
}
Detailed steps with screenshots:
Create OIC Rest connection:
Create a rest trigger connection:
Create an app driven integration and configure the Rest trigger
Take a scope and configure OIC rest invoke adapter to update lookup
Content as decodebase64ToReference
Different exception details variables
Create a lookup
No comments:
Post a Comment