Passing attribute values from Workflow to Task Rule execution

Which IIQ version are you inquiring about?

8.3

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

Hello ,

We have a use case in SailPoint IdentityIQ where a Workflow launches a Task using TaskManager.runSync() and needs to pass an identity attribute value (such as identityName) to a Rule executed by a Task Rule .

The main goal is for the Workflow to send the value, for the Task to carry it during execution, and for the Rule to retrieve it in order to perform processing .

The issue is ensuring the correct and supported mechanism for passing this runtime argument from Workflow → Task → Rule and reading it inside the Rule .

Best Regard

Hi @alshahim04 ,

can you elaborate more on your use case?

Thank you,

Harikrishna

@alshahim04 You can pass the variable as an task attribute to Task while launching it:

Attributes attrs = new Attributes();
attrs.put("variableName", variableValue);

TaskManager taskMgr = new TaskManager(context);
TaskDefinition taskdefinition = taskMgr.getTaskDefinition("your task name");
TaskResult newTaskResult = taskMgr.runWithResult(taskdefinition, attrs);

and later on read the task definition object inside the rule which can give you all the task arguments including the one which you passed from workflow.

TaskDefinition tdef = result.getDefinition();
Object variableValue = tdef.getArgument("variableName");

There could be some error on the methods, but this is just an idea on how can pass the attribute from workflow to task to rule.

Hello @neel193 ,

Thanks for your reply,

The solution works, but the variable is persisted in the task definition,

Is there a possibility to make it temporary?

Can you remove it via your rule?

@alshahim04 You can remove it via rule. Also, you can directly launch the rule as well with the necessary arguments, this can avoid the task. Please see if it work for you, then you don’t need to maintain the task.