public virtual void testDecisionInstancePropertiesOfDecisionLiteralExpression()
        {
            IDecisionDefinition decisionDefinition = repositoryService.CreateDecisionDefinitionQuery().First();

            decisionService.EvaluateDecisionByKey("decision").Variables(ESS.FW.Bpm.Engine.Variable.Variables.CreateVariables().PutValue("sum", 2205)).Evaluate();

            IQueryable <IHistoricDecisionInstance> query = historyService.CreateHistoricDecisionInstanceQuery() /*/*.IncludeInputs()*//*.IncludeOutputs()*/;

            Assert.That(query.Count(), Is.EqualTo(1L));

            IHistoricDecisionInstance historicDecisionInstance = query.First();

            Assert.That(historicDecisionInstance.DecisionDefinitionId, Is.EqualTo(decisionDefinition.Id));
            Assert.That(historicDecisionInstance.DecisionDefinitionKey, Is.EqualTo("decision"));
            Assert.That(historicDecisionInstance.DecisionDefinitionName, Is.EqualTo("Decision with Literal Expression"));
            Assert.That(historicDecisionInstance.EvaluationTime, Is.Not.Null);

            Assert.That(historicDecisionInstance.Inputs.Count, Is.EqualTo(0));

            IList <IHistoricDecisionOutputInstance> outputs = historicDecisionInstance.Outputs;

            Assert.That(outputs.Count, Is.EqualTo(1));

            IHistoricDecisionOutputInstance output = outputs[0];

            Assert.That(output.VariableName, Is.EqualTo("result"));
            Assert.That(output.TypeName, Is.EqualTo("string"));
            Assert.That((string)output.Value, Is.EqualTo("ok"));

            Assert.That(output.ClauseId, Is.EqualTo(null));
            Assert.That(output.ClauseName, Is.EqualTo(null));
            Assert.That(output.RuleId, Is.EqualTo(null));
            Assert.That(output.RuleOrder, Is.EqualTo(null));
        }
        public virtual void testCompoundDecisionOutputInstances()
        {
            startProcessInstanceAndEvaluateDecision();

            IHistoricDecisionInstance historicDecisionInstance = historyService.CreateHistoricDecisionInstanceQuery() /*.IncludeOutputs()*/.First();
            IList <IHistoricDecisionOutputInstance> outputs    = historicDecisionInstance.Outputs;

            Assert.That(outputs.Count, Is.EqualTo(2));

            IHistoricDecisionOutputInstance firstOutput = outputs[0];

            Assert.That(firstOutput.ClauseId, Is.EqualTo("out1"));
            Assert.That(firstOutput.RuleId, Is.EqualTo("rule1"));
            Assert.That(firstOutput.RuleOrder, Is.EqualTo(1));
            Assert.That(firstOutput.VariableName, Is.EqualTo("result1"));
            Assert.That(firstOutput.Value, Is.EqualTo((object)"okay"));

            IHistoricDecisionOutputInstance secondOutput = outputs[1];

            Assert.That(secondOutput.ClauseId, Is.EqualTo("out2"));
            Assert.That(secondOutput.RuleId, Is.EqualTo("rule1"));
            Assert.That(secondOutput.RuleOrder, Is.EqualTo(1));
            Assert.That(secondOutput.VariableName, Is.EqualTo("result2"));
            Assert.That(secondOutput.Value, Is.EqualTo((object)"not okay"));
        }
 public virtual void AddOutput(IHistoricDecisionOutputInstance decisionOutputInstance)
 {
     if (outputs == null)
     {
         outputs = new List <IHistoricDecisionOutputInstance>();
     }
     outputs.Add(decisionOutputInstance);
 }
        public virtual void decisionOutputInstanceValue()
        {
            startProcessInstanceAndEvaluateDecision(inputValue);

            IHistoricDecisionInstance historicDecisionInstance      = engineRule.HistoryService.CreateHistoricDecisionInstanceQuery() /*.IncludeOutputs()*/.First();
            IList <IHistoricDecisionOutputInstance> outputInstances = historicDecisionInstance.Outputs;

            Assert.That(outputInstances.Count, Is.EqualTo(1));

            IHistoricDecisionOutputInstance outputInstance = outputInstances[0];

            Assert.That(outputInstance.TypeName, Is.EqualTo(valueType));
            Assert.That(outputInstance.Value, Is.EqualTo(inputValue));
        }
        public virtual void testDecisionOutputInstanceProperties()
        {
            startProcessInstanceAndEvaluateDecision();

            IHistoricDecisionInstance historicDecisionInstance = historyService.CreateHistoricDecisionInstanceQuery() /*.IncludeOutputs()*/.First();
            IList <IHistoricDecisionOutputInstance> outputs    = historicDecisionInstance.Outputs;

            Assert.That(outputs, Is.Not.Null);
            Assert.That(outputs.Count, Is.EqualTo(1));

            IHistoricDecisionOutputInstance output = outputs[0];

            Assert.That(output.DecisionInstanceId, Is.EqualTo(historicDecisionInstance.Id));
            Assert.That(output.ClauseId, Is.EqualTo("out"));
            Assert.That(output.ClauseName, Is.EqualTo("output"));

            Assert.That(output.RuleId, Is.EqualTo("rule"));
            Assert.That(output.RuleOrder, Is.EqualTo(1));

            Assert.That(output.VariableName, Is.EqualTo("result"));
        }
 protected internal virtual bool IsBinaryValue(IHistoricDecisionOutputInstance decisionOutputInstance)
 {
     return(AbstractTypedValueSerializer <ITypedValue> .BINARY_VALUE_TYPES.Contains(decisionOutputInstance.TypeName));
 }