Exemple #1
0
        protected internal virtual IList <string> collectHistoricDecisionInstanceIds()
        {
            ISet <string> collectedDecisionInstanceIds = new HashSet <string>();

            IList <string> decisionInstanceIds = HistoricDecisionInstanceIds;

            if (decisionInstanceIds != null)
            {
                collectedDecisionInstanceIds.addAll(decisionInstanceIds);
            }

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.engine.impl.HistoricDecisionInstanceQueryImpl decisionInstanceQuery = (org.camunda.bpm.engine.impl.HistoricDecisionInstanceQueryImpl) historicDecisionInstanceQuery;
            HistoricDecisionInstanceQueryImpl decisionInstanceQuery = (HistoricDecisionInstanceQueryImpl)historicDecisionInstanceQuery;

            if (decisionInstanceQuery != null)
            {
                foreach (HistoricDecisionInstance hdi in decisionInstanceQuery.list())
                {
                    collectedDecisionInstanceIds.Add(hdi.Id);
                }
            }

            return(new List <string>(collectedDecisionInstanceIds));
        }
Exemple #2
0
        protected internal virtual long getDecisionInstanceCount(CommandContext commandContext)
        {
            HistoricDecisionInstanceQueryImpl historicDecisionInstanceQuery = new HistoricDecisionInstanceQueryImpl();

            historicDecisionInstanceQuery.decisionDefinitionId(decisionDefinitionId);

            return(commandContext.HistoricDecisionInstanceManager.findHistoricDecisionInstanceCountByQueryCriteria(historicDecisionInstanceQuery));
        }
Exemple #3
0
 public virtual long findHistoricDecisionInstanceCountByQueryCriteria(HistoricDecisionInstanceQueryImpl query)
 {
     if (HistoryEnabled)
     {
         configureQuery(query);
         return((long?)DbEntityManager.selectOne("selectHistoricDecisionInstanceCountByQueryCriteria", query).Value);
     }
     else
     {
         return(0);
     }
 }
Exemple #4
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.HistoricDecisionInstance> getHistoricDecisionInstances(java.util.Date evaluatedAfter, java.util.Date evaluatedAt, int maxResults)
        public virtual IList <HistoricDecisionInstance> getHistoricDecisionInstances(DateTime evaluatedAfter, DateTime evaluatedAt, int maxResults)
        {
            checkIsAuthorizedToReadHistoryOfDecisionDefinitions();

            IDictionary <string, object> @params = new Dictionary <string, object>();

            @params["evaluatedAfter"] = evaluatedAfter;
            @params["evaluatedAt"]    = evaluatedAt;
            @params["maxResults"]     = maxResults;

            IList <HistoricDecisionInstance> decisionInstances = DbEntityManager.selectList("selectHistoricDecisionInstancePage", @params);

            HistoricDecisionInstanceQueryImpl query = (HistoricDecisionInstanceQueryImpl)(new HistoricDecisionInstanceQueryImpl()).disableBinaryFetching().disableCustomObjectDeserialization().includeInputs().includeOutputs();

            HistoricDecisionInstanceManager.enrichHistoricDecisionsWithInputsAndOutputs(query, decisionInstances);

            return(decisionInstances);
        }
Exemple #5
0
        public virtual void enrichHistoricDecisionsWithInputsAndOutputs(HistoricDecisionInstanceQueryImpl query, IList <HistoricDecisionInstance> decisionInstances)
        {
            IDictionary <string, HistoricDecisionInstanceEntity> decisionInstancesById = new Dictionary <string, HistoricDecisionInstanceEntity>();

            foreach (HistoricDecisionInstance decisionInstance in decisionInstances)
            {
                decisionInstancesById[decisionInstance.Id] = (HistoricDecisionInstanceEntity)decisionInstance;
            }

            if (decisionInstances.Count > 0 && query.IncludeInput)
            {
                appendHistoricDecisionInputInstances(decisionInstancesById, query);
            }

            if (decisionInstances.Count > 0 && query.IncludeOutputs)
            {
                appendHistoricDecisionOutputInstances(decisionInstancesById, query);
            }
        }
Exemple #6
0
 public virtual void configureHistoricDecisionInstanceQuery(HistoricDecisionInstanceQueryImpl query)
 {
     configureQuery(query, DECISION_DEFINITION, "RES.DEC_DEF_KEY_", READ_HISTORY);
 }
Exemple #7
0
 protected internal virtual void configureQuery(HistoricDecisionInstanceQueryImpl query)
 {
     AuthorizationManager.configureHistoricDecisionInstanceQuery(query);
     TenantManager.configureQuery(query);
 }
Exemple #8
0
        protected internal virtual void appendHistoricDecisionOutputInstances(IDictionary <string, HistoricDecisionInstanceEntity> decisionInstancesById, HistoricDecisionInstanceQueryImpl query)
        {
            IList <HistoricDecisionOutputInstanceEntity> decisionOutputInstances = findHistoricDecisionOutputInstancesByDecisionInstanceIds(decisionInstancesById.Keys);

            initializeOutputInstances(decisionInstancesById.Values);

            foreach (HistoricDecisionOutputInstanceEntity decisionOutputInstance in decisionOutputInstances)
            {
                HistoricDecisionInstanceEntity historicDecisionInstance = decisionInstancesById[decisionOutputInstance.DecisionInstanceId];
                historicDecisionInstance.addOutput(decisionOutputInstance);

                // do not fetch values for byte arrays eagerly (unless requested by the user)
                if (!isBinaryValue(decisionOutputInstance) || query.ByteArrayFetchingEnabled)
                {
                    fetchVariableValue(decisionOutputInstance, query.CustomObjectDeserializationEnabled);
                }
            }
        }
Exemple #9
0
        public virtual IList <HistoricDecisionInstance> findHistoricDecisionInstancesByQueryCriteria(HistoricDecisionInstanceQueryImpl query, Page page)
        {
            if (HistoryEnabled)
            {
                configureQuery(query);

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<org.camunda.bpm.engine.history.HistoricDecisionInstance> decisionInstances = getDbEntityManager().selectList("selectHistoricDecisionInstancesByQueryCriteria", query, page);
                IList <HistoricDecisionInstance> decisionInstances = DbEntityManager.selectList("selectHistoricDecisionInstancesByQueryCriteria", query, page);

                enrichHistoricDecisionsWithInputsAndOutputs(query, decisionInstances);

                return(decisionInstances);
            }
            else
            {
                return(Collections.emptyList());
            }
        }