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 6818889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:14:00+00:00 2026-05-26T21:14:00+00:00

I am building a workflow in my code, and I don’t know how I

  • 0

I am building a workflow in my code, and I don’t know how I can add a simple (While) condition. Tried to figure out how, but no luck with it, search on the internet but no luck either.

This is a simplified version of what I am trying to do:

ActivityBuilder ab = new ActivityBuilder();
ab.Implementation = new Sequence()
{
  Variables = 
  {
     new Variable<int>("StepNo", 0)
  },

  Activities =
  {
    new While()
    {
      Condition = <the_condition>

      Body = 
      {
        //Some logic here and the StepNo is increased
      }
    }
  }   
}

The While condition should be something like “StepNo < 10”. Any idea how can this be made?

  • 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-26T21:14:00+00:00Added an answer on May 26, 2026 at 9:14 pm
    var stepNo = new Variable<int>("stepNo", 0);
    
    var activity = new Sequence
    {
        Variables = 
        {
            stepNo
        },
    
        Activities = 
        {
            new While
            {
                Condition = new LessThan<int,int,bool>
                {
                    Left = stepNo,
                    Right = 10
                },
    
                Body = new Sequence
                {
                    Activities = 
                    {
                        new Assign<int>
                        {
                            To = stepNo,
                            Value = new Add<int, int, int>
                            {
                                Left = stepNo,
                                Right = 1
                            }
                        },
    
                        new WriteLine
                        { 
                            Text = new VisualBasicValue<string>("\"Step: \" & stepNo") 
                        }
                    }
                }
            }
        }
    };
    

    Or a version without expression activities but only with VisualBasicValue, which is also an activity:

    var stepNo = new Variable<int>("stepNo", 0);
    
    var activity = new Sequence
    {
        Variables = 
        {
            stepNo
        },
    
        Activities = 
        {
            new While
            {
                Condition = new VisualBasicValue<bool>("stepNo < 10"),
    
                Body = new Sequence
                {
                    Activities = 
                    {
                        new Assign<int>
                        {
                            To = stepNo,
                            Value = new VisualBasicValue<int>("stepNo + 1")
                        },
    
                        new WriteLine
                        { 
                            Text = new VisualBasicValue<string>("\"Step: \" & stepNo") 
                        }
                    }
                }
            }
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a workflow app to investigate the technology. I can't decide whether to
I am trying to figure out a git workflow. At the moment we have
I haven't quite figured out a sensible workflow for building packages and writing their
Just out of curiosity, does anyone know a better way of building the following
I'm building a VERY simple sequential workflow in WF4. I have 3 sequential activities
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
Today, I had a training on Microsoft Workflow Foundation. While I think the idea
I am building a Windows Workflow into a .Net webapp. The problem I have
Let's say you are building a Python-based web app that requires some workflow management
I'm working with Workflow Foundation 4 and Entity Framework 4.1. I am building my

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.