How to set auto generate name for custom workflow task result

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

I am trying to create a custom workflow form where i am trying to set the task result name using the follwoing code

wfcontext.getWorkflowCase().getTaskResult().setName("Logical Application Request :"+newApplicationName);
if there is a already a task result with the same name, it is throwing a unique key constraint error, which i understand,
but if i remember correctly this is used to work in older version by appending numbers at the end, such as “Logical Application Request :Temp -1” automatically without additional logic.
Is that deprecated or am i missing something ?

Hi @chaitanyav

Try in 8.3 below approach. we did upgrade and found similar issues.

suggested : https://community.sailpoint.com/t5/IdentityIQ-Wiki/Scheduling-a-workflow-to-run-in-the-future-from-BeanShell-rule/ta-p/74197

https://community.sailpoint.com/t5/IdentityIQ-Forum/Unable-to-launch-Workflow-using-scheduleWorkflowEvent-method/m-p/8150




@chaitanyav
Looks like this is a known issue , try appending epoch timestamp, whcih will take care of your problem

	Date date = new Date();
        long timeMilli = date.getTime();
taskResultName=Logical Application Request :"+newApplicationName+ "-"+timeMilli;

It will take care of the problem, unless and until they are unlucky enough to happen to have two instances of that workflow run in the same millisecond…

Finally figured out the issue.
if the workflow case rename step is right next to form launch step it works, otherwise it throws error. if it is right next to form step the task results gets updated with number automatically.
not sure why though.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.