protected internal static DmnModelInstance createDmnModelInstanceNegativeHistoryTimeToLive() { DmnModelInstance modelInstance = Dmn.createEmptyModel(); Definitions definitions = modelInstance.newInstance(typeof(Definitions)); definitions.Id = DmnModelConstants.DMN_ELEMENT_DEFINITIONS; definitions.Name = DmnModelConstants.DMN_ELEMENT_DEFINITIONS; definitions.Namespace = DmnModelConstants.CAMUNDA_NS; modelInstance.Definitions = definitions; Decision decision = modelInstance.newInstance(typeof(Decision)); decision.Id = "Decision-1"; decision.Name = "foo"; decision.CamundaHistoryTimeToLive = -5; modelInstance.Definitions.addChildElement(decision); return(modelInstance); }
protected internal static DmnModelInstance createDmnModelInstance() { DmnModelInstance modelInstance = Dmn.createEmptyModel(); Definitions definitions = modelInstance.newInstance(typeof(Definitions)); definitions.Id = DmnModelConstants.DMN_ELEMENT_DEFINITIONS; definitions.Name = DmnModelConstants.DMN_ELEMENT_DEFINITIONS; definitions.Namespace = DmnModelConstants.CAMUNDA_NS; modelInstance.Definitions = definitions; Decision decision = modelInstance.newInstance(typeof(Decision)); decision.Id = "Decision-1"; decision.Name = "foo"; decision.CamundaHistoryTimeToLive = 5; modelInstance.Definitions.addChildElement(decision); DecisionTable decisionTable = modelInstance.newInstance(typeof(DecisionTable)); decisionTable.Id = DmnModelConstants.DMN_ELEMENT_DECISION_TABLE; decisionTable.HitPolicy = HitPolicy.FIRST; decision.addChildElement(decisionTable); Input input = modelInstance.newInstance(typeof(Input)); input.Id = "Input-1"; input.Label = "Input"; decisionTable.addChildElement(input); InputExpression inputExpression = modelInstance.newInstance(typeof(InputExpression)); inputExpression.Id = "InputExpression-1"; Text inputExpressionText = modelInstance.newInstance(typeof(Text)); inputExpressionText.TextContent = "input"; inputExpression.Text = inputExpressionText; inputExpression.TypeRef = "string"; input.InputExpression = inputExpression; Output output = modelInstance.newInstance(typeof(Output)); output.Name = "output"; output.Label = "Output"; output.TypeRef = "string"; decisionTable.addChildElement(output); return(modelInstance); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testDeployEmptyDecisionDefinition() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: public virtual void testDeployEmptyDecisionDefinition() { // given empty decision model DmnModelInstance modelInstance = Dmn.createEmptyModel(); Definitions definitions = modelInstance.newInstance(typeof(Definitions)); definitions.Id = DmnModelConstants.DMN_ELEMENT_DEFINITIONS; definitions.Name = DmnModelConstants.DMN_ELEMENT_DEFINITIONS; definitions.Namespace = DmnModelConstants.CAMUNDA_NS; modelInstance.Definitions = definitions; // when decision model is deployed DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().addModelInstance("foo.dmn", modelInstance); DeploymentWithDefinitions deployment = testRule.deploy(deploymentBuilder); // then deployment contains no definitions assertNull(deployment.DeployedDecisionDefinitions); assertNull(deployment.DeployedDecisionRequirementsDefinitions); // and there are no persisted definitions assertNull(repositoryService.createDecisionDefinitionQuery().decisionDefinitionResourceName("foo.dmn").singleResult()); }