Ejemplo n.º 1
0
        public override async Task FollowUp()
        {
            //Remove child activity if its not specified or add it if is not yet added
            if (string.IsNullOrEmpty(ActivityUI.DataSourceSelector.Value))
            {
                await HubCommunicator.DeleteExistingChildNodesFromActivity(ActivityId);

                ActivityContext.ActivityPayload.ChildrenActivities.Clear();
                PreviousSelectedDataSourceId = null;
                CachedData = null;
            }
            else if (string.IsNullOrEmpty(PreviousSelectedDataSourceId) || PreviousSelectedDataSourceId != ActivityUI.DataSourceSelector.Value)
            {
                var activityTemplate = await HubCommunicator.GetActivityTemplate(Guid.Parse(ActivityUI.DataSourceSelector.Value));

                await HubCommunicator.DeleteExistingChildNodesFromActivity(ActivityId);

                ActivityContext.ActivityPayload.ChildrenActivities.Clear();
                await HubCommunicator.AddAndConfigureChildActivity(ActivityContext.ActivityPayload, activityTemplate, order : 1);

                PreviousSelectedDataSourceId = ActivityUI.DataSourceSelector.Value;
                CachedData = null;
            }
        }