Beispiel #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testDeployEmptyCaseDefinition() throws Exception
        public virtual void testDeployEmptyCaseDefinition()
        {
            // given empty case model
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.model.cmmn.CmmnModelInstance modelInstance = org.camunda.bpm.model.cmmn.Cmmn.createEmptyModel();
            CmmnModelInstance modelInstance = Cmmn.createEmptyModel();

            org.camunda.bpm.model.cmmn.instance.Definitions definitions = modelInstance.newInstance(typeof(org.camunda.bpm.model.cmmn.instance.Definitions));
            definitions.TargetNamespace = "http://camunda.org/examples";
            modelInstance.Definitions   = definitions;

            // when case model is deployed
            DeploymentWithDefinitions deployment = repositoryService.createDeployment().addModelInstance("foo.cmmn", modelInstance).deployWithResult();

            deploymentIds.Add(deployment.Id);

            // then no case definition is deployed
            assertNull(deployment.DeployedCaseDefinitions);

            // and there exist not persisted case definition
            assertNull(repositoryService.createCaseDefinitionQuery().caseDefinitionResourceName("foo.cmmn").singleResult());
        }
Beispiel #2
0
        protected internal static CmmnModelInstance createCmmnModelInstance()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.model.cmmn.CmmnModelInstance modelInstance = org.camunda.bpm.model.cmmn.Cmmn.createEmptyModel();
            CmmnModelInstance modelInstance = Cmmn.createEmptyModel();

            org.camunda.bpm.model.cmmn.instance.Definitions definitions = modelInstance.newInstance(typeof(org.camunda.bpm.model.cmmn.instance.Definitions));
            definitions.TargetNamespace = "http://camunda.org/examples";
            modelInstance.Definitions   = definitions;

            Case caseElement = modelInstance.newInstance(typeof(Case));

            caseElement.Id = "a-case";
            definitions.addChildElement(caseElement);

            CasePlanModel casePlanModel = modelInstance.newInstance(typeof(CasePlanModel));

            caseElement.CasePlanModel = casePlanModel;

            Cmmn.writeModelToStream(System.out, modelInstance);

            return(modelInstance);
        }