Skip to main content

Can someone provide an example of a custom expression to use when scheduling a Run Application Server Task?  I have a task that should run WEEKLY ON MON AT 17:00 but if Monday is a Holiday I want it to run on TUES.  Our holidays are defined in work_time_exception_code.

Hi @anntarr,

You are supposed to use Oracle expressions that return a date/time value as the expression. SQL statements are not allowed as a custom expression. However a function call which returns a date value can be used.

Eg:

Instead of using...

select DATE_FROM 
from IFSAPP.ACCOUNTING_PERIOD t
where t.COMPANY = '10' AND t.ACCOUNTING_YEAR = '2016'
AND ACCOUNTING_PERIOD = 1;

...the function call given below can be used:

ACCOUNTING_PERIOD_API.Get_Date_From(10,2016,1);

So I think you can create a Util package in the database and write a function to return the date as you need and then use that function as the expression. 

Following post has an example expression using Oracle expressions:

Hope this helps!


Hi @Charith Epitawatta 

 

It depends if we are talking about Application Server Tasks or Database Tasks.

For the second, Oracle scheduler settings are acceptable:

https://docs.oracle.com/database/121/ARPLS/d_sched.htm

ex: FREQ=MONTHLY;BYDAY=1SUN;BYHOUR=12


Give this a try: 

 ifsapp.work_time_calendar_api.Get_Next_Work_Day('*', next_day(SYSDATE, 'MONDAY' )-1)+ (1020/60/24)

Just change * to the name of the Calendar you are using linked to the exceptions.


Thanks, that worked!


Reply