Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9150151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:34:29+00:00 2026-06-17T11:34:29+00:00

I have one question about Windows Workflow Foundation 4. I have an activity named

  • 0

I have one question about Windows Workflow Foundation 4. I have an activity named PositionArrayActivity. This activity has a Sequence activity inside it. I need that in Execute method (during the workflow execution) oneFund variable mapping his value to PORTFOLIO_NAME that is created in Create method…. What have I to do to mapping oneFund value to PORTFOLIO_NAME at runtime?

Thanks

public sealed class PositionArrayActivity : NativeActivity, IActivityTemplateFactory
{
    [Browsable(false)]
    public Dictionary<string, List<Entity>> dictionary = new Dictionary<string, List<Entity>>();
    public ActivityAction<Entity[]> Body { get; set; }
    public Entity[] PositionList { get; set; }
    public SqlDataReader rdr;
    public SqlDataReader sdr;
    public Entity[] positionArray;
    public List<String> fundList;
    public String oneFund { get; set; }
    public String date { get; set; }
    public List<Entity> listToArrayPositions;

    protected override void CacheMetadata(NativeActivityMetadata metadata)
    {
        metadata.AddDelegate(Body);
    }

    protected override void Execute(NativeActivityContext context)
    {
       // A lot of code.... 
    }


    public Activity Create(DependencyObject target)
    {
        Variable<string> var = new Variable<string>
        {
            Name = "PORTFOLIO_NAME"
        };

        var fef = new PositionArrayActivity();  
        var aa = new ActivityAction<Entity[]>();
        var da = new DelegateInArgument<Entity[]>();
        da.Name = "positions";
        fef.Body = aa;
        aa.Argument = da;
        aa.Handler = new Sequence
        {
            Variables = { var }
        };

        return fef;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:34:29+00:00Added an answer on June 17, 2026 at 11:34 am

    You need to have an ActivityContext to set a variable value so first move the declaration of the var (did that name actually compile?) to a higher scope.

    Then in Execute
    var.Set(activityContext, oneFund);

    One thing though, the oneFund property will only be set once at application startup so you may have some surprising results. If you wanted that to be for each instance, you need an inargument.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one question about Yii framework, and I need your help. Basicly, I
i have one question about jquery ajax().. I created a table grid and there
I have one question about searching and counting files in directories and subdirectories. I
Ok, i have one totaly noob question about php sessions: I have 3 (and
I have a question about Criteria method, one-to-many relation to the database, 'one' is
I am learning JPA and have one question: In which situations we need more
In response to my question about Windows API's, I have successfully gotten it to
I am starting GUI programming and I have a question about windows. I have
This question is not about timing something accurately on Windows (XP or better), but
I know about this question , but I have the source and I'm having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.