11-29-2019 02:55 AM
Dear Experts,
I understand how to pass an Output of one Task to another but i have following Scenario. A
ssume there are total 3 Tasks. 1st Task check existance of an object and if it exist then get the object id as a Output of this Task. 2nd Task is executed if object does not exist in the System then it first add and then get the object ID as a Output of the Task.
object ID is required as Input in order to run Task 3.
from the logic perspective either Task 1 will be execute or Task 2 will be exexuted and therefore i can not use Task(x).outputvar as the Input of 3rd Task. I thought of storing this result in workflow Output but when i pass ${workflowoutvar} to the Input of 3rd Task, it does not get any value.
am i missing something? how to solve this?
-KAKA-
01-06-2020 03:57 AM
Hi
you could try this:
Assign the outputs from both task1 & task2 to inputs of a new custom task, with which you check whether the output of task1 or task2 is set. Based on that set the output --> then use the output of the custom task as an input for your task3.
---------------------------------------
example custom task code:
// input.input1 = task1.outputX
// input.input2 = task2.outputX
if (input.input1)
{
output.ObjectID = input.input1
}
else if (input.input2)
{
output.ObjectID = input.input2
}
---------------------------------------
i didn't test this code, so if you want to use it, you might need to do some changes to it, but it's just about the idea on how to possibly solve your problem.
01-06-2020 04:05 AM - edited 01-06-2020 04:06 AM
Thank you for your response. I thought about this approach but somehow i found this as not good use case of the custom Task. btw i was able to solve this Problem by creating a compound Task. -KAKA-
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide