Hi! We have a script taks with a exception flow , we have configured the timer with this:
If the script task delay more than 15 second it has to go in flow exception, but it doesnt
Any option??
Regards,Rebeca
Discussion posts and replies are publicly visible
Why are you planning a design around a script task exception?What's driving that long duration?
how is your process always successful if you sometimes skip this task?
Try now() + intervalds(0, 0, 15)
i tried it and it doesnt work...
This scriptTask calls a rule expression, this rule expression fills cdts calling two integrations...and it delays sometimes 5second and another times two minutes and we need to avoid the 2 minutes with this flow exception, with the timer.
I understand that it's easier said than done - but the focus should be on aligning the external web service performance with your needs. Generally, I don't use exceptions on script tasks as it feels like planning for failure, which goes against my principles.
Also, again, how is your process designed to work correctly if, some of the time, certain web services inputs are missing. Are these inputs optional?
now() + intervalds(0, 0, 15) is exactly how I get a timer node to work. It should work there as well. If you're fresh out of other ideas, maybe try splitting the process flow and dedicating a timer node to bypassing this when it goes off.
Now, for explanation of why your original code doesn't work. All times in Appian are stored as the number of milliseconds since January 1, 2035. Since that hasn't happened yet, all Appian times we're familiar with are actually stored as negative numbers. It's actually quite ingenious; as Appian continues to age, the space used to store a date will actually shrink rather than grow like Linux or Mac OS who use Jan 1, 1970.
How it's configured in the timer code above is actually 1 equals a day; it does conversions from that before storage. So the fractional part you established is actually equal to 15 seconds, but it's positive 15 seconds. 15 seconds after the epoch. Your original code is perfectly configured to go off at exactly 00:00:15 January 1, 2035 and never again afterward.
I know this is an old thread, but we ran into same scenario. I had to wrap the script task in a subprocess to get this to work. Ideally, I would like to trigger the exception flow as soon as exception happens rather than skipping the node after preset time interval. Is there a way to achieve this.
Can you describe your scenario? What kind of expression are you executing in your script task? If you're calling an integration there is a better way to set this up, since the integration contains a timeout parameter: Integration Object.
It's legacy code where we have an expression with multiple integrations (read-only) being executed from that rule. We do have timeout set to 10 sec in integration rule. However, if the integration errors out due to any issue ( e.g., network connectivity issue), we would like to retry the entire expression
I think you're better off having a gateway after the script task that can check the results and decide whether to retry it. If you have a timeout in your integration, then the integration should never take more than 10 seconds (and the node should complete successfully), so then you can use the results to decide what to do next.
In general I'd recommend only using exceptions on nodes that are attended (e.g. Script Task, Sub-Process). Any other nodes it's usually better to have th node complete and then use logic in a gateway to determine what to do next.