Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void setup()
        {
            modelInstance = Cmmn.createEmptyModel();
            definitions   = modelInstance.newInstance(typeof(Definitions));
            definitions.TargetNamespace = "http://camunda.org/examples";
            modelInstance.Definitions   = definitions;

            caseDefinition = createElement(definitions, "aCaseDefinition", typeof(Case));
            casePlanModel  = createElement(caseDefinition, "aCasePlanModel", typeof(CasePlanModel));

            context = new CmmnHandlerContext();

            CaseDefinitionEntity caseDefinition = new CaseDefinitionEntity();

            caseDefinition.TaskDefinitions = new Dictionary <string, TaskDefinition>();
            context.CaseDefinition         = caseDefinition;

            ExpressionManager expressionManager = new ExpressionManager();

            context.ExpressionManager = expressionManager;

            DeploymentEntity deployment = new DeploymentEntity();

            deployment.Id      = "foo";
            context.Deployment = deployment;
        }
Esempio n. 2
0
        protected internal virtual T createElement <T>(CmmnModelElementInstance parentElement, Type elementClass) where T : org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance
        {
            elementClass = typeof(T);
            T element = modelInstance.newInstance(elementClass);

            parentElement.addChildElement(element);
            return(element);
        }
Esempio n. 3
0
        public static T createElement <T>(CmmnModelInstance modelInstance, CmmnModelElementInstance parentElement, string id, Type elementClass) where T : org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance
        {
            elementClass = typeof(T);
            T element = modelInstance.newInstance(elementClass);

            element.setAttributeValue("id", id, true);
            parentElement.addChildElement(element);
            return(element);
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void setup()
        {
            CmmnTransformer transformerWrapper = new CmmnTransformer(null, new DefaultCmmnElementHandlerRegistry(), null);

            transformer = new CmmnTransform(transformerWrapper);

            deployment    = new DeploymentEntity();
            deployment.Id = "aDeploymentId";

            transformer.Deployment = deployment;

            modelInstance = Cmmn.createEmptyModel();
            definitions   = modelInstance.newInstance(typeof(Definitions));
            definitions.TargetNamespace = "http://camunda.org/examples";
            modelInstance.Definitions   = definitions;

            caseDefinition = createElement(definitions, "aCaseDefinition", typeof(Case));
            casePlanModel  = createElement(caseDefinition, "aCasePlanModel", typeof(CasePlanModel));
        }
Esempio n. 6
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());
        }