Why to run schedule integration now:
- Creates an ad-hoc integration run for a scheduled integration. This is useful when you want to test you schedule integration.
Relative URI: /ic/api/integration/v1/integrations/{id}/schedule/jobs/
Scenario1: we will create a schedule service accepting few parameters and then run it now from postman tool.
Implementation steps:
Step1: Create a schedule integration and mention the schedule parameters as required. Maximum you can define 5 parameters. Here I have mentioned following 3 params:
p_email : ""
p_fileName : ""
p_reportPath: ""
Step2: add a logger activity and concat 3 these params to show in log testing time. Add tracking and save and activate it.
Step3: open POSTMAN and provide the following details.
Verb : Post
URL: https://oic_instance_hostname:port/ic/api/integration/v1/integrations/{id}/schedule/jobs
Here Id: identifiername|version = POC19_scheduleintegrat|01.00.0000
| = %7C
In authrization tab, add basic authrization and provide username and password.
In Body tab, choose raw type and select JSON and provide the below payload:
{
"action":"NOW",
"parameters": [{
"name": "p_reportPath",
"value": "report_path"
},{
"name": "p_fileName",
"value": "put_filename"
},{
"name": "p_email",
"value": "provide_emailId"
}]
}
Or we can also use following:
{
"runAsSchedule" : false,
"parameters": [{
"name": "p_reportPath",
"value": "report_path"
},{
"name": "p_fileName",
"value": "put_filename"
},{
"name": "p_email",
"value": "provide_emailId"
}]
}
Note: If you mention runAsSchedule : true then the integration should have a active schedule in simple or ical. Otherwise it will fail with:
HTTP 412 Precondition failed.
Can not submit the run as part of the schedule because its not active.
Click on Send button and check from OIC monitoring and check activity stream and you will see the data in logger.
Scenario 2: we will create another intergration and from there we will run the schedule integration now.
Implementation steps:
Step1: Create a schedule integration and mention the schedule parameters as required. Maximum you can define 5 parameters. Here I have mentioned following 3 params:
p_email : ""
p_fileName : ""
p_reportPath: ""
Step2: add a logger activity and concat 3 these params to show in log testing time. Add tracking and save and activate it.
Step3: create a Rest_OIC_Invoke connection with below details:
Role: Trigger and Invoke
Connection Type: Rest API Base URL
Connection URL: https://your_oic_instance_hostname/
Security: Basic Authetication and provide Username and Password.
And test and save it.
Step4: create an app driven integration and choose the created rest connection as trigger point and provide following details:
Endpoint name: callSchedileInt and next
Verb : post
URI: /call
And as we are not passing any params here so not configuring anything just next and save.
Step5: drag and drop the rest connection as invoke point and provide following details:
Verb: post
Relative URI: /ic/api/integration/v1/integrations/{id}/schedule/jobs/
Add select option -Configure a request payload for this endpoint.
Next
Next
In request section, choose jason sample and click inline and add the following payload:
{
"action":"NOW",
"Parameters": [{
"name": "p_email",
"value": "email"
},{
"name": "p_fileName",
"value": "put_filename"
},{
"name": "p_reportPath",
"value": "yourreportpath"
}]
}
Next
Done
Step6: go to the mapping part and map the following:
Id: POC19_scheduleintegrat|01.00.0000
Action: NOW
Repeat node for parameters 3 times for name value pair:
Name: p_email
Value: "youremail"
Name: p_fileName
Value: "yourfilename"
Name: p_reportPath
Value: "yourreportpath"
Step7: add tracking and save and activate and test
You can also call schedule integration which does not have any schedule parameters for that you have to use below json payload:
payload:
{
"action":"NOW"
}