locked
wf - passing a value to an activity RRS feed

  • Question

  • Hello
    I re-hosted workflow designer, I want the user to build his workflow by custom activities I've been made.
    I used :


    new ToolboxCategory("new Toolbox")
                        {                       
                           Tools=
                           {
                                new ToolboxItemWrapper("ActivityLibrary1.StillTrying","ActivityLibrary1",null,"Approve"),

    I put in the activity file (.xaml) file, IF activity. the IF condition is

    ( argument1 = True )// case boolean

    or ( argument1 = "yes")// case string

    The user will drag and drop the activity to the designer, then will press Run button, the workflow will execute, it executes the (Then condition) because it didn't see the if condition (agrument1 )is set.

    How can I pass the value for this argument while I'm working in the run time?
    Where can I put a breakpoint to see the execute of IF activity, and control it?
    Thank you

    Thursday, July 7, 2011 11:33 AM

Answers

All replies

  • Hi,

    ->"How can I pass the value for this argument while I'm working in the run time?
    Where can I put a breakpoint to see the execute of IF activity, and control it?
    Thank you
    "

    You need a custom bookmark activity to get the condition data while workflow running. here is a sample of bookmark:
    http://xhinker.com/post/WF4Use-Bookmark.aspx

    Here is also a Rehosted workflow designer could be helpful to you:
    http://xhinker.com/post/WF4Custom-WF4-Designer.aspx

    Regards
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Marked as answer by Andrew_Zhu Thursday, July 14, 2011 2:51 AM
    Wednesday, July 13, 2011 6:31 AM
  • Thank you:)
    but how can I use the input value in another place?? 
    Saturday, July 16, 2011 3:24 PM
  •         public void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj)
            {
                // When the Bookmark is resumed, assign its value to
                // the Result argument.
                Result.Set(context, (string)obj);
    but where the Result is defined? and how can I use it in another actvitiy as an input for next or another activity?
    Saturday, July 16, 2011 4:53 PM
  • Result could be just be an argument (property) on the activity class e.g.

    public OutArgument<string> Result { get; set; }

    or it could be there because you inherited CodeActivity<T>, Activity<T>, etc.
    Tim

    Monday, July 18, 2011 5:58 PM