Ejemplo n.º 1
0
        public virtual IList <IHistoricTaskInstanceReportResult> SelectHistoricTaskInstanceCountByTaskNameReport(HistoricTaskInstanceReportImpl query)
        {
            var pdQuery = from a in DbContext.Set <ProcessDefinitionEntity>()
                          group a by new { a.Key, a.TenantId }
            into g select
            new
            {
                Key      = g.Key.Key,
                TenantId = g.Key.TenantId,
                Version  = g.Max(o => o.Version)
            };

            var tempQuery = from a in DbContext.Set <HistoricTaskInstanceEventEntity>()
                            join b in pdQuery
                            on a.ProcessDefinitionKey equals b.Key
                            where
                            a.TenantId == b.TenantId || (string.IsNullOrEmpty(a.TenantId) && string.IsNullOrEmpty(b.TenantId))
                            select new
            {
                a.Id,
                a.Name,
                b.TenantId,
                b.Version,
                a.ProcessDefinitionKey
            };
            var innerQuery = from q in tempQuery
                             group q by new { q.Name, q.ProcessDefinitionKey, q.Version, q.TenantId }
            into g
                select new
            {
                Name     = g.Key.Name,
                Key      = g.Key.ProcessDefinitionKey,
                Version  = g.Key.Version,
                TenantId = g.Key.TenantId,
                Count    = g.Count(),
            };

            return((from a in innerQuery
                    join b in DbContext.Set <ProcessDefinitionEntity>() on
                    new
            {
                a.Key,
                a.Version,
                a.TenantId
            }
                    equals
                    new
            {
                b.Key,
                b.Version,
                b.TenantId
            }
                    where !string.IsNullOrEmpty(a.Name)
                    orderby a.Name, a.Count
                    select new TaskReportResultEntity()
            {
                Count = a.Count,
                ProcessDefinitionKey = b.Key,
                ProcessDefinitionId = b.Id,
                ProcessDefinitionName = b.Name,
                TaskName = a.Name,
                TenantId = a.TenantId,
            }).ToList <IHistoricTaskInstanceReportResult>());

            //return result;
            //ConfigureQuery(query);
            //return ListExt.ConvertToListT<IHistoricTaskInstanceReportResult>(DbEntityManager.SelectListWithRawParameter("selectHistoricTaskInstanceCountByTaskNameReport", query, 0, int.MaxValue));
        }
Ejemplo n.º 2
0
 //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
 //ORIGINAL LINE: @SuppressWarnings("unchecked") public java.Util.List<org.camunda.bpm.engine.history.DurationReportResult> createHistoricTaskDurationReport(org.camunda.bpm.engine.impl.HistoricTaskInstanceReportImpl query)
 public virtual IList <IDurationReportResult> CreateHistoricTaskDurationReport(HistoricTaskInstanceReportImpl query)
 {
     throw new NotImplementedException();
     //ConfigureQuery(query);
     // return ListExt.ConvertToListT<IDurationReportResult>(DbEntityManager.SelectListWithRawParameter("selectHistoricTaskInstanceDurationReport", query, 0, int.MaxValue));
 }