Monday, October 10, 2011

How to override the default resultLimit value within a workflow.

We have a use case where based on certain user actions within a workflow the
results of task instance should be indefinitely retained or deleted. I can set
the resultOption at the TaskDefinition level but it will always delete or retain
the instance. 

Is there a programmatic way of setting the resultOptions value (to either delete
or wait) within the workflow?
ANSWER:
You can set the resultLimit option for the TaskInstance by using the following
workflow Action:

 <Action application='SET_RESULT_LIMIT'>
   <Argument name='limit' value='0'/>
 </Action>

Set the limit in seconds that a task instance is allowed to live after the task
has completed.

A limit of zero means that the TaskInstance will be deleted immediately after
the task is complete. 

A limit of -1 means that the TaskInstance will never be automatically deleted,
though it may be manually deleted by the user.

No comments:

Post a Comment