Doron Brikman
Doron Brikman

Reputation: 2584

How to access return value from a custom code activity?

I build a simple custom native activity that return a string value.

public sealed class MyActivity : NativeActivity<string>
{
     public InArgument<string> Id { get; set; }

     protected override void Execute(NativeActivityContext context)
     {
         var returnString = QuerySomthing();

         context.SetValue<string>(base.Result, returnString);
     }
}

How can I get this value in the workflow's variables?

Upvotes: 0

Views: 854

Answers (1)

DotNetHitMan
DotNetHitMan

Reputation: 951

You can access the 'Result' property of your activity. All you need to do is create a variable on the workflow (of type String) and bind this to the 'Result' property. Then you can access the variable later on in the workflow to analyse its value. HTH

enter image description here

Upvotes: 1

Related Questions