Success or failure condition for custom activity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 04:17 AM
Hi All,
I want to learn orchestration custom powershell activities, so i created a custom activity to just ping one server if we get response then it should go to next acitivity otherwise workflow should end.
Workflow command:
$script:checkHostReachability_Output=Invoke-Command -ScriptBlock {
Test-Connection -ComputerName test -Quiet
}
echo "StandardOperator_Output=$checkHostReachability_Output"
$script:checkHostReachability_Return=if($script:checkHostReachability_Output -eq $true) {0} else {1}
echo "checkHostReachability_Return=$checkHostReachability_Return"
In the out put i defined
In conditions, i used below
success: activityOutput.checkHostReachability_Return == 0
failure: activityOutput.checkHostReachability_Return == 1
But evn though it is giving correct repsonse, tyhe transition is not going to next task. Did i miss anything to include here?
Thanks and regards,
Swamy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2017 05:24 PM
Hi Swamy,
Did you get this figured out? I'm having a similar issue in that I am trying to use the activity.result in my condition, and it will not set correctly. Just wondering if you have any insight into fixes. Thanks!
Jason
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2017 08:33 PM
Swamy,
A couple quick thoughts:
- Try putting the numbers in quotes in your conditions. For example, activityOutput.checkHostReachability_Return == '0'
- How are you setting these output values in the Parsing rules? I see it is direct, but this next step should help you validate that it is set the way you expect.
- Validate that your activity outputs are correct. In the post processing, you can write to the system log. Something like this: gs.log("checkHostReachability is: " + activityOutput.checkHostReachability_Return,"CUSTOMACTIVITY"); // You can search on CUSTOMACTIVITY or whatever you use in these quotes in the Source column to easily find your log info.
Ben