DidIReallyWriteThat
DidIReallyWriteThat

Reputation: 1033

workflow passing out values between activities

I have a CodeActivity GetEstimatedArrivalTime that gets a datetime and returns it as an out argument.

In the designer view, how can I take this value input it into the sequence diagram?

public sealed class CodeActivityGetEVA : CodeActivity
{
    public InArgument<int> EventID { get; set; }
    public OutArgument<DateTime> EVA {get;set;}

    protected override void Execute(CodeActivityContext context)
    {
        EVA.Set(context, DateTime.Now);
    }

Upvotes: 0

Views: 945

Answers (1)

Joao
Joao

Reputation: 7476

Initialize a variable at sequence level (lets call it "EstimatedArrivalTimeVar") and attach it to CodeActivityGetEVA's EVA out argument. From then on you can use EstimatedArrivalTimeVar with the value assigned to it.

Note that you can use a CodeActivity with a TResult as an out argument already available:

public sealed class CodeActivityGetEVA : CodeActivity<DateTime>
{
    public InArgument<int> EventID { get; set; }

    protected override DateTime Execute(CodeActivityContext context)
    {
        return DateTime.Now;
    }
}

Upvotes: 1

Related Questions