Back in September, I wrote a post which had some SQL to provide a list of Workflow timeout values which can be used in profile option values.
The code sample below was something that Gary Derrick put together which does a similar task, albeit more simplified than the version I produced in the original post:
SQL="SELECT a.meaning, a.v INTO :visible_option_value, :profile_option_value FROM (SELECT DECODE(LEVEL - 1,0,'No Timeout' , DECODE(LEAST(LEVEL - 1,59),LEVEL - 1,TO_CHAR(LEVEL - 1) ||' Minute' ||DECODE(LEVEL - 1,1,'','s') , DECODE(LEAST(LEVEL - 1,1439),LEVEL - 1,TO_CHAR((LEVEL - 1)/60) ||' Hour' ||DECODE(LEVEL-1,60,'','s') , TO_CHAR((LEVEL-1)/1440) ||' Day' ||DECODE(LEVEL - 1,1440,'','s')))) meaning , LEVEL - 1 v FROM dual CONNECT BY LEVEL <= 7200 ) a WHERE a.v IN (0, 1,2, 60, 120, 1440, 2880)" COLUMN="Meaning(15)" HEADING="Timeout(15)"
The code generates a list of values based on the number of minutes you specify in the WHERE clause. In this example, the list of values would be no timeout (0), 1 Minute(1), 2 Minutes (2), 1 Hour (60), 2 Hours (120), 1 Day (1440), 2 Days (2880) – if you want different values, then change the number of minutes to include in the query.
The value of the profile option can then be retrieved directly by the Workflow process without any need to manipulate it – it’s ready to use in the code, but is also human-friendly in terms of what the LOV displays.
Hope you find it useful – thanks Gary!