A quick recap on schedule parameters
Schedule Parameter feature supports adding scalar variables for Scheduled Orchestration Integrations. These parameter values are available across scheduled runs for the particular Integration and can be overridden by downstream actions like Assign. A maximum of five schedule parameters can be defined per Integration.
Requirements like the following can be achieved by using schedule parameters:
As mentioned above, schedule parameters can be updated in the orchestration by using Assign.
Please refer Oracle Documentation for more details about this feature.
How to override schedule parameters
Today if user wants to invoke a Scheduled Integration (containing schedule parameters) with different parameter values, they need to deactivate the Integration, configure a new default value and activate it back.
Schedule parameter override feature enables user to provide parameter values while invoking the Integration without deactivating it. This feature is controlled by feature flag oic.ics.console.schedule.parameter-override-support.
Once the feature is enabled, a popup will be displayed when user clicks Submit Now or Start Schedule - for Integrations that have schedule parameters defined. Users can view the Default and Current Value of parameters and, if required, input a New Value to override the Current/ Default values.
The New Value field is optional. If no new values are specified then Current Value will be considered for next Run. If Current Value is also empty then Default Value will be considered.
If the integration updates these schedule parameter values using Assign, then the updated value will be saved and will become the Current Value for the next Run.
Schedule parameter values for Submit Now and Scheduled Runs
Typically for a given Integration, schedule parameter values for Submit Now and Start Schedule use cases are not shared.
So if user defines new schedule parameter values as part of Submit Now operation it will be saved and shown as Current Value for all subsequent Submit Now operations. It will not impact the saved parameter values of Start Schedule.
In certain usecases, it might be required to share schedule parameter values between a scheduled Run and a Submit Now Run. To enable sharing, Run as part of schedule checkbox needs to be enabled when doing a Submit Now operation. Below image shows the option:
Note: Run as part of schedule checkbox shows up only if there is a schedule defined for the integration.
Based on the checkbox selection, appropriate Current Value and Default Value will be displayed in the table.
Updating schedule parameter values of a scheduled Run after starting schedule
Schedule parameter values of a scheduled Run can be updated in-between Runs. In order to do this, use the menu item Update Schedule Parameters in the Schedule and Future Runs page. This will launch schedule parameter popup and allow updating the values which will be used for the next Run.
Note: If any Run is in running state then update operation is not allowed. Updating parameter values is only allowed in-between Runs as mentioned above.
REST API:
Configure Schedule Parameter:
Schedule parameters can be passed while submitting job using REST API.
$ curl -1 -u <username>:<password> -k -v -X POST -H 'Content-Type:application/json' -d '{"runAsSchedule" : true/false,"parameters":[{"name": "<param_name_1>","value": "<value of param_1>"},{"name":"<param_name_2","value":"<value of _param_2"}]}' https://<hostname>/ic/api/integration/v1/integrations/<Integration_code>%7C<integration_version>/schedule/jobs
Note:
runAsSchedule is optional parameter and it is required if user decides to submit job as part of schedule.
parameters indicates the schedule parameters and user can pass the value for one or more schedule parameters. This is an optional field.
Updating schedule parameters between runs:
Below REST API allows users to update schedule parameters in between runs of a scheduled run. User can update one or more schedule parameter values using this API.
$ curl -1 -u <username>:<password> -k -v -X PATCH -H 'Content-Type:application/json' -d ‘{"parameters":[{"name": "<param_name_1>","value": "<value of param_1>"},{"name":"<param_name_2","value":"<value of _param_2"}]}' http://<hostname>/ic/api/integration/v1/integrations/<Integration_code>%7C<integration_version>/schedule/parameters
It's a nice blog.Could you please also explain from what version onwards it is available and how to enable this feature in your current ICS environment.
Thanks,
Hina
This functionality is available only in OIC. And is available all OIC environments.
It is not available in ICS.
The feature flag to enable the feature is mentioned in the blog. You need to raise an SR to get this feature flag enabled for your OIC environment.
Thanks,
Arya
In case , I want to schedule integration to run for two areas "EMEA" and "APAC" (considering area is my scheduled parameter).
How can I pass two different value of 'area' in one schedule ? I want my integration to run daily 5pm for both EMEA and APAC.
Regards,
Rishabh
Are there two separate integrations - one for "EMEA" and another for "APAC"?
Or do you have a singular integration modeled for both areas?
Thanks,
Arya
One way to achieve your usecase is to have 2 separate integrations - say ScheduleAreaJob and ExecuteArea.
1. ExecuteArea defines a schedule parameter "area" and has a switch case logic that checks for the value of "area".
2. The first branch of the switch has the logic to execute for "EMEA" area. And the second branch has the logic for "APAC".
3. The second scheduled Integration "ScheduleAreaJob" can call ExecuteArea twice using the Call Integration action. First time it calls ExecuteArea and passes "EMEA" as the value of schedule parameter "area".
4. Second call of ExecuteArea passes "APAC" as the value of schedule parameter "area".
5. Now define a schedule for ScheduleAreaJob and configure it to run every day at 5:00PM.
This will ensure ExecuteArea gets called twice - once for EMEA and next for APAC at 5:00PM.
Hope this helps. Feel free to ask questions if you have any.
Thanks,
Arya
Thank you very much for your suggestion.
Actually I was looking to use single integration to schedule for both the areas.
But anyways looks like (from below meta-link) that we can not schedule same integration twice so there is no point of over-riding the schedule parameter in my use-case. Either I have to clone the same integration or add one more integration (for schedule) as you suggested above.
https://support.oracle.com/epmos/faces/DocContentDisplay?_afrLoop=357771499007560&id=2520103.1&_afrWindowMode=0&_adf.ctrl-state=g12gsb28r_251
Thanks & Regards,
Rishabh
https://cloudcustomerconnect.oracle.com/posts/82cf35aedb?commentId=269853#269853
Yes your solution should also work. Care should be taken while modeling to avoid any infinite loops that might occur due to this recursive call.
Would suggest to start with a simplistic usecase locally and then incrementally improve it to support the end goal.
Thanks,
Arya
What is your usecase for the run date? Can you please elaborate?
In Assign, you can use the current date function and increment it by one.