Пример #1
0
        public List <ResponceEntryPoints> GetProcessEntryPointsData(string entitySchemaUId, string entityId)
        {
            entitySchemaUId.CheckArgumentNullOrEmpty("entitySchemaUId");
            entityId.CheckArgumentNullOrEmpty("entityId");
            UserConnection userConnection   = UserConnection;
            var            response         = new List <ResponceEntryPoints>();
            var            entryPointSelect =
                (Select) new Select(userConnection)
                .Column("SysProcessElementDataId")
                .From("EntryPoint")
                .Where("EntitySchemaUId").IsEqual(Column.Parameter(new Guid(entitySchemaUId)))
                .And("EntityId").IsEqual(Column.Parameter(new Guid(entityId)))
                .And("IsActive").IsEqual(Column.Parameter(true));
            IProcessEngine processEngine = userConnection.IProcessEngine;

            using (DBExecutor dbExecutor = userConnection.EnsureDBConnection()) {
                using (IDataReader reader = entryPointSelect.ExecuteReader(dbExecutor)) {
                    DBTypeConverter dbTypeConverter = userConnection.DBTypeConverter;
                    while (reader.Read())
                    {
                        Guid elementId             = dbTypeConverter.DBValueToGuid(reader[0]);
                        var  sysProcessElementData = new SysProcessElementData(userConnection);
                        if (!sysProcessElementData.FetchFromDB(elementId))
                        {
                            continue;
                        }
                        Guid    sysProcessId = sysProcessElementData.SysProcessId;
                        Process process      = processEngine.FindProcessByUId(sysProcessId.ToString(), true);
                        if (process == null)
                        {
                            continue;
                        }
                        var processActivity = (ProcessActivity)process.FindFlowElementByUId(elementId);
                        BaseProcessSchemaElement schemaElement = processActivity.GetSchemaElement();
                        response.Add(new ResponceEntryPoints {
                            id      = elementId.ToString(),
                            caption = schemaElement.Caption
                        });
                    }
                }
            }
            return(response);
        }
Пример #2
0
 public SysProcessElementData(SysProcessElementData source)
     : base(source)
 {
 }
 public SysProcessElementData(Terrasoft.Configuration.SysProcessElementData source)
     : base(source)
 {
     this.CopyEntityLookupProperties(source);
 }