How to get the WorkItemId when using StartAndWait method
I am using activity StartAndWait method to perform a set of tasks and also I wanted to use CancelActivity (for cancelling the activity started using StartAndWait method) when a user clicks stop button on the windows UI.
I got to know that WorkItemId is returned when using StartActivity method but can you please elaborate on how to get the WorkItemId when using StartAndWait method as the return type is WorkItemResult rather than an integer as in the case of StartActivity.
NOTE: As a work around for time being, I got to know the WorkItemId value using StartActivity in the debug mode and hardcoded the integer value parameter in the CancelActivity method. I would like to get the WorkItemId value during runtime and assign the same value to CancelActivity method.