views:

537

answers:

0

I've have a workflow whose root activity is a custom NativeActivity with a public InArgument called XmlData. When I try and use this argument in a child If activity I get the following error using XmlData within the condition:

'XmlData' is not declared. It may be inaccessible due to its protection level

My properties look like this:

public Activity Body {get;set;}
public InArgument<CustomObj> XmlData {get;set;}

and this is the CacheMetadata method:

protected override void CacheMetadata(NativeActivityMetadata metadata)
    {
        var runtime = new RuntimeArgument("XmlData",typeof(CustomObj),ArgumentDirection.In,true);
        metadata.Bind(this.XmlData,runtime);
        metadata.AddArgument(runtime);

        metadata.AddChild(Body);
    }

I'm adding the argument inside CacheMetadata using the metadata.AddArgument method, and I've tried adding the child property it has using both AddChild and AddImplementationChild.

If I replace my custom activity with an ActivityBuilder and use code to create a DynamicActivityProperty then the condition can be compiled successfully, so I don't see what I'm missing when I use my own code.