locked
Custom Composite Activity and ActivityScheduledRecord RRS feed

  • Question

  • Hello

    I'm trying to work out why I am not getting any ActivityScheduledRecords created when the composite parts of my custom activity execute.

    A simplified version of the custom activity's implementation looks something like this:

     

     

    Pick pick = new Pick
    {
      Branches =
    {
                    new
    PickBranch { Trigger = new Sequence { Activities = { ACTIVITY_A } } },
                    new PickBranch { Trigger = new Sequence { Activities = { ACTIVITY_B } } }
    }
    };

     

     

     I have tried inheriting from Activity and using the above implementation and also building the above up in a NativeActivity. With no records created for the component parts (pick, branch, sequences, etc) being created in either case.

    My belief is that the problem lies with the fact that these are in the Implementation of the activity. When I created the natcive activity version. I had the add the components using metadata.AddImplementationChild. I tried to use metadata.AddChild but got errors  such as

    ': The private implementation of activity '1: CustomActivity' has the following validation error: The activity 'CustomActivity' cannot reference activity 'Pick' because activity 'Pick' is already referenced elsewhere in the workflow and that reference is not visible to activity 'Escalation'.

    Could someone please explain what is going here.

    Thankyou

    Darren


    Darren
    Wednesday, March 2, 2011 10:01 AM

Answers

  • Hi, Darren

    ->"My belief is that the problem lies with the fact that these are in the Implementation of the activity. When I created the natcive activity version. I had the add the components using metadata.AddImplementationChild. I tried to use metadata.AddChild but got errors such as "

    Could you paste the NativeActivity code here.
    There are two kinds of children in an activity. my understand is that, implementation child is like a private child which can only be used and referenced inside an activity. while there is another kind of child: we can call it public child, this kind of child can be accessd and referenced by other public child and its subactivity children.

    AddImplementationChild will add child as private.
    AddChild will add child as public.
    Public children can only see public variables, and implementation children can only see implementation variables.

    Hope this helps
    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 Wednesday, March 9, 2011 1:40 AM
    Monday, March 7, 2011 2:56 AM