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

  • SEARCH
  • Home
  • 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 6578923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:50:00+00:00 2026-05-25T15:50:00+00:00

I m with a list of custom activities(written in code behind, C#) where each

  • 0

I m with a list of custom activities(written in code behind, C#) where each is derived from NativeActivity, now I’m adding all these activities to a sequence with the help of a foreach loop.
now the question is, how I should proceed if I need to get some value from an activity and to pass it on to another activity.

Say, activity1 sets a string property value to “some file name”(lets an image file path) and based on that the activity next to it which so ever is added into the sequence with the help of for loop, takes it as input to flip that image.

Logic for getting the file is thre in Execute method of activity1 and the same to flip the image in Execute method of activity2.

thanks in advance

  • 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-05-25T15:50:01+00:00Added an answer on May 25, 2026 at 3:50 pm
            var workflow = new Sequence();           
            Variable<Dictionary<string,object>> variable = new Variable<Dictionary<string,object>>
            {
                Name = "SharedData"
            };
            workflow.Variables.Add(variable);
            foreach (MyCustomActivity activity in mAddedActivities)
            {                
                workflow.Activities.Add(activity);                                      
            }
    
            WorkflowInvoker invoker = new WorkflowInvoker(workflow);
            invoker.Invoke();
    

    This is what i Did for the actual implementation, there is no need of any inargument/outargument, The variable “Shared Data” is capable enough to hold the data across activities.

    Now at each activity level in overridden code activity “Execute” method, you must use this excerpt of code to fetch input/fetch the value of this workflow variable, “SharedData”.

            WorkflowDataContext dataContext = context.DataContext;
            PropertyDescriptorCollection propertyDescriptorCollection = dataContext.GetProperties();
            foreach (PropertyDescriptor propertyDesc in propertyDescriptorCollection)
            {
                if (propertyDesc.Name == "SharedData")
                {
                    myData = propertyDesc.GetValue(dataContext) as Dictionary<string, object>;
                    if (myData == null) //this to check if its the initial(1st) activity.
                        myData = new Dictionary<string, object>();
                    //I'm adding here an additional value into the workflow variable 
                    //its having signature same as that of workflow variable
                    //dictionary's key as what it is and value as an object
                    //which user can cast to what actually one wants.
                    myData.Add("islogonrequired", Boolean.TrueString);
    
    
                    //here I'm fetching some value, as i entered it in my previous activity. 
                    string filePath = myData["filepath"].ToString();
                    propertyDesc.SetValue(dataContext, myData);
                    break;
                }
            }
    

    Hope this might help others..
    Thanks everyone else out there for their help n support.

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

Sidebar

Related Questions

I have a list of custom objects. These objects have 2 datetime properties on
I have a list of custom colors that I use in all the UI
I have a list of custom types, they need to be saved/loaded to/from a
I implemented a custom list view, but now there's no visual feedback that an
I have created a custom titlebar for all my listview activities using the following
I have a custom list which inherits from Generic.List<T> like this: public class TransferFileList<T>
I have an application with many list activities (5-6 of them), and all of
I have a custom list view that is getting data from server and changing
If a custom list control is to be developed for S60 5th edition phones,
I have a list of custom objects List and I would like to update

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.