Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite activity doesn't call activities providers when using InputActivityObject #4075

Closed
wants to merge 7 commits into from

Conversation

stuartmcgillivray
Copy link

When building a composite activity with an activity that includes a property marked with ActivityInputObjectAttribute, propertyProviders aren't checked for that property so the Set method is never called.

In this example setting up the InternalActivity, it will run the Set() method on the Test property but not on TestAgain property.

  public class TestCompositeActivity : CompositeActivity
    {
        [ActivityInputObject]
        public Test Test
        {
            get => GetState<Test>();
            set => SetState(value);

        }

        public override void Build(ICompositeActivityBuilder builder)
        {
            builder
                .Then<InternalActivity>(setup =>
                {
                    setup.Set(c => c.Test, () =>
                    {
                        return Test;
                    });
                    setup.Set(c => c.TestAgain, () =>
                    {
                        return Test;
                    });

                });
        }

    }

    public class InternalActivity : Activity
    {
        [ActivityInput]
        public Test Test { get; set; }

        [ActivityInputObject]
        public Test TestAgain { get; set; }
        protected override async ValueTask<IActivityExecutionResult> OnExecuteAsync(ActivityExecutionContext context)
        {
            return Done();
        }
    }

This update will check if there is a provider for a nested property marked with ActivityInputObjectAttribute before trying to iterate though all its'properties.

@stuartmcgillivray stuartmcgillivray marked this pull request as ready for review May 29, 2023 14:58
@stuartmcgillivray stuartmcgillivray marked this pull request as draft May 30, 2023 11:20
@stuartmcgillivray stuartmcgillivray closed this by deleting the head repository Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant