- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 03:51 AM
Hi Everyone,
I have created if condition with custom activities based on multiple condition as shown below, the condition is true and log messages are captured but the return value is "no" instead of returning a string based on condition match and which will not match with activity.result and failing the flow of workflow. Please let me know how to fix it.
one of the activities condition
Thanks,
Sowmya
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 07:47 AM
Hi Sowmya,
I recently came across a similar situation, and as a workaround used several redundant workflow.scratchpad in the if else ladder, and later used a switch .The switch conditions for paths had the workflow scratchpad.
For eg.
in run script :
if(this ==this){
workflow.scratchpad.first='true';
}
else if(this== that){
workflow.scratchpad.first='true';
workflow.scratchpad.second='true';
}
else{
workflow.scratchpad.first='true';
workflow.scratchpad.second='true';
workflow.scratchpad.third='true';
}
in switch conditions, for one path i used workflow.scratchpad.first=='true'; similarly i used workflow.scratchpad.second='true'; in other and so on..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 05:59 AM
It sounds more like you want a Switch statement than an "if". An if usually returns a binary "yes" or "no". You might have better luck with a switch as it is designed to handle multiple cases more effectively.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 07:30 AM
Thank you.
Switch is based on field/variable but I need to have multiple variables as shown in the earlier snippet and only when all condition meets I need to trigger a particular task for which "switch" doesn't work. Please let me know why adding activities in "If" condition won't work?. Also, please suggest me how can I replicate the requirement if not using "IF condition".
Thanks,
Sowmya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 07:47 AM
Hi Sowmya,
I recently came across a similar situation, and as a workaround used several redundant workflow.scratchpad in the if else ladder, and later used a switch .The switch conditions for paths had the workflow scratchpad.
For eg.
in run script :
if(this ==this){
workflow.scratchpad.first='true';
}
else if(this== that){
workflow.scratchpad.first='true';
workflow.scratchpad.second='true';
}
else{
workflow.scratchpad.first='true';
workflow.scratchpad.second='true';
workflow.scratchpad.third='true';
}
in switch conditions, for one path i used workflow.scratchpad.first=='true'; similarly i used workflow.scratchpad.second='true'; in other and so on..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 08:26 AM
Thank you.
Can you please let me know what is the purpose of setting all the scatchpad variable to true in "Run script" as the loop gets increased.
Please help me out in switch condition as I'm not able to find advanced script field to add "workflow.scratchpad.first=='true'; " and so on. It will be great help if you show me steps for adding the condition in switch.
Thanks,
Sowmya