/// <summary>
        /// Setups the activity data.
        /// </summary>
        /// <param name="activity">The activity.</param>
        public void SetupActivityData(IWebActivity activity)
        {
            if (activity != null)
            {
                SavedInputMapping  = activity.SavedInputMapping;
                SavedOutputMapping = activity.SavedOutputMapping;
                ActivityType       = activity.UnderlyingWebActivityObjectType;
                _complexObjects    = new List <ComplexObjectItemModel>();
                if (activity.ResourceModel != null)
                {
                    string inputs;
                    string outputs;

                    // handle workflows differently ;)

                    if (activity.IsNotAvailable())
                    {
                        inputs  = activity.ResourceModel.Inputs;
                        outputs = activity.ResourceModel.Outputs;
                    }
                    else
                    {
                        var datalist = activity.ResourceModel.DataList;
                        AddComplexObjects(datalist);
                        inputs = DataListUtil.GenerateSerializableDefsFromDataList(datalist,
                                                                                   enDev2ColumnArgumentDirection.Input);
                        outputs = DataListUtil.GenerateSerializableDefsFromDataList(datalist,
                                                                                    enDev2ColumnArgumentDirection.Output);
                    }

                    ActivityInputDefinitions  = inputs;
                    ActivityOutputDefinitions = outputs;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Setups the activity data.
        /// </summary>
        /// <param name="activity">The activity.</param>
        public void SetupActivityData(IWebActivity activity)
        {
            if (activity != null)
            {
                SavedInputMapping  = activity.SavedInputMapping;
                SavedOutputMapping = activity.SavedOutputMapping;
                ActivityType       = activity.UnderlyingWebActivityObjectType;

                if (activity.ResourceModel != null)
                {
                    IsWorkflow = activity.ResourceModel.ResourceType == Studio.Core.AppResources.Enums.ResourceType.WorkflowService;

                    string inputs;
                    string outputs;

                    // handle workflows differently ;)
                    if (IsWorkflow)
                    {
                        //if (!activity.ResourceModel.Environment.IsLocalHost && !activity.ResourceModel.Environment.HasLoadedResources)
                        if (activity.IsNotAvailable())
                        {
                            inputs  = activity.ResourceModel.Inputs;
                            outputs = activity.ResourceModel.Outputs;
                        }
                        else
                        {
                            var datalist = activity.ResourceModel.DataList;

                            inputs = DataListUtil.GenerateSerializableDefsFromDataList(datalist,
                                                                                       enDev2ColumnArgumentDirection.Input);
                            outputs = DataListUtil.GenerateSerializableDefsFromDataList(datalist,
                                                                                        enDev2ColumnArgumentDirection.Output);
                        }
                    }
                    else
                    {
                        // handle services ;)
                        inputs  = activity.ResourceModel.Inputs;
                        outputs = activity.ResourceModel.Outputs;
                    }

                    ActivityInputDefinitions  = inputs;
                    ActivityOutputDefinitions = outputs;
                }
            }
        }