示例#1
0
        /// <summary>
        /// Creates activity connection dynamic column parameter if it doesn't exist.
        /// </summary>
        /// <param name="userConnection">User connection.</param>
        /// <param name="target">Target user task schema.</param>
        public static void SynchronizeActivityConnectionParameters(UserConnection userConnection,
                                                                   ProcessUserTaskSchema target)
        {
            EntitySchemaManager manager  = userConnection.EntitySchemaManager;
            EntitySchema        activity = manager.GetInstanceByName("Activity");

            activity.LoadLocalizableValues();
            EntitySchemaQuery esq = CreateActivityConnectionEsq(manager, activity.UId);
            EntityCollection  activityConnections = esq.GetEntityCollection(userConnection);

            foreach (Entity connection in activityConnections)
            {
                Guid columnUId            = connection.GetTypedColumnValue <Guid>("ColumnUId");
                EntitySchemaColumn column = activity.Columns.FindByUId(columnUId);
                if (column == null)
                {
                    _log.InfoFormat("Activity connection column with identifier \"{0}\" not found", columnUId);
                }
                else
                {
                    CreateDynamicProcessSchemaParameterIfNotExist(target, column);
                }
            }
        }