当前位置: 首页>>代码示例>>Java>>正文


Java Cmmn类代码示例

本文整理汇总了Java中org.camunda.bpm.model.cmmn.Cmmn的典型用法代码示例。如果您正苦于以下问题:Java Cmmn类的具体用法?Java Cmmn怎么用?Java Cmmn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Cmmn类属于org.camunda.bpm.model.cmmn包,在下文中一共展示了Cmmn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: starting

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Override
protected void starting(Description description) {

  if(description.getAnnotation(CmmnModelResource.class) != null) {

    Class<?> testClass = description.getTestClass();
    String methodName = description.getMethodName();

    String resourceFolderName = testClass.getName().replaceAll("\\.", "/");
    String cmmnResourceName = resourceFolderName + "." + methodName + ".cmmn";

    InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(cmmnResourceName);
    try {
      CmmnModelInstance = Cmmn.readModelFromStream(resourceAsStream);
    } finally {
      IoUtil.closeSilently(resourceAsStream);
    }

  }

}
 
开发者ID:camunda,项目名称:camunda-cmmn-model,代码行数:22,代码来源:ParseCmmnModelRule.java

示例2: shouldNotAbleToAddNewElement

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void shouldNotAbleToAddNewElement() {
  CmmnModelInstance modelInstance = getCmmnModelInstance();
  CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next();

  HumanTask humanTask = modelInstance.newInstance(HumanTask.class);
  casePlanModel.getPlanItemDefinitions().add(humanTask);

  try {
    Cmmn.writeModelToStream(System.out, modelInstance);
    fail("cannot save cmmn 1.0 model");
  }
  catch (Exception e) {
    // expected exception
  }
}
 
开发者ID:camunda,项目名称:camunda-cmmn-model,代码行数:17,代码来源:Cmmn10Test.java

示例3: shouldNotAbleToAddCmmn10Element

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void shouldNotAbleToAddCmmn10Element() {
  CmmnModelInstance modelInstance = Cmmn.readModelFromStream(Cmmn10Test.class.getResourceAsStream("Cmmn11Test.cmmn"));
  CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next();

  Event event = modelInstance.newInstance(Event.class);
  casePlanModel.getPlanItemDefinitions().add(event);

  try {
    Cmmn.writeModelToStream(System.out, modelInstance);
    fail("cannot save cmmn 1.1 model");
  }
  catch (Exception e) {
    // expected exception
  }
}
 
开发者ID:camunda,项目名称:camunda-cmmn-model,代码行数:17,代码来源:Cmmn10Test.java

示例4: createCmmnModelInstance

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
protected static CmmnModelInstance createCmmnModelInstance() {
  final CmmnModelInstance modelInstance = Cmmn.createEmptyModel();
  org.camunda.bpm.model.cmmn.instance.Definitions definitions = modelInstance.newInstance(org.camunda.bpm.model.cmmn.instance.Definitions.class);
  definitions.setTargetNamespace("http://camunda.org/examples");
  modelInstance.setDefinitions(definitions);

  Case caseElement = modelInstance.newInstance(Case.class);
  caseElement.setId("a-case");
  definitions.addChildElement(caseElement);

  CasePlanModel casePlanModel = modelInstance.newInstance(CasePlanModel.class);
  caseElement.setCasePlanModel(casePlanModel);

  Cmmn.writeModelToStream(System.out, modelInstance);

  return modelInstance;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:CmmnDeployerTest.java

示例5: testDeployEmptyCaseDefinition

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
public void testDeployEmptyCaseDefinition() throws Exception {

    // given empty case model
    final CmmnModelInstance modelInstance = Cmmn.createEmptyModel();
    org.camunda.bpm.model.cmmn.instance.Definitions definitions = modelInstance.newInstance(org.camunda.bpm.model.cmmn.instance.Definitions.class);
    definitions.setTargetNamespace("http://camunda.org/examples");
    modelInstance.setDefinitions(definitions);

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

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

    // and there exist not persisted case definition
    assertNull(repositoryService.createCaseDefinitionQuery().caseDefinitionResourceName("foo.cmmn").singleResult());
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:CmmnDeployerTest.java

示例6: testManualActivationRule

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testManualActivationRule() {
  // given
  ItemControl itemControl = createElement(discretionaryItem, "ItemControl_1", ItemControl.class);
  ManualActivationRule manualActivationRule = createElement(itemControl, "ManualActivationRule_1", ManualActivationRule.class);
  ConditionExpression expression = createElement(manualActivationRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(discretionaryItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_MANUAL_ACTIVATION_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:StageDiscretionaryItemHandlerTest.java

示例7: testManualActivationRuleByDefaultPlanItemControl

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testManualActivationRuleByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(stage, "ItemControl_1", DefaultControl.class);
  ManualActivationRule manualActivationRule = createElement(defaultControl, "ManualActivationRule_1", ManualActivationRule.class);
  ConditionExpression expression = createElement(manualActivationRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(discretionaryItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_MANUAL_ACTIVATION_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:StageDiscretionaryItemHandlerTest.java

示例8: testRequiredRule

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testRequiredRule() {
  // given
  ItemControl itemControl = createElement(discretionaryItem, "ItemControl_1", ItemControl.class);
  RequiredRule requiredRule = createElement(itemControl, "RequiredRule_1", RequiredRule.class);
  ConditionExpression expression = createElement(requiredRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(discretionaryItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_REQUIRED_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:StageDiscretionaryItemHandlerTest.java

示例9: testRequiredRuleByDefaultPlanItemControl

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testRequiredRuleByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(stage, "ItemControl_1", DefaultControl.class);
  RequiredRule requiredRule = createElement(defaultControl, "RequiredRule_1", RequiredRule.class);
  ConditionExpression expression = createElement(requiredRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(discretionaryItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_REQUIRED_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:StageDiscretionaryItemHandlerTest.java

示例10: testManualActivationRuleByDefaultPlanItemControl

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testManualActivationRuleByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(humanTask, "ItemControl_1", DefaultControl.class);
  ManualActivationRule manualActivationRule = createElement(defaultControl, "ManualActivationRule_1", ManualActivationRule.class);
  ConditionExpression expression = createElement(manualActivationRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(discretionaryItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_MANUAL_ACTIVATION_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:HumanTaskDicretionaryItemHandlerTest.java

示例11: testRequiredRuleByDefaultPlanItemControl

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testRequiredRuleByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(humanTask, "ItemControl_1", DefaultControl.class);
  RequiredRule requiredRule = createElement(defaultControl, "RequiredRule_1", RequiredRule.class);
  ConditionExpression expression = createElement(requiredRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(discretionaryItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_REQUIRED_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:HumanTaskDicretionaryItemHandlerTest.java

示例12: testRequiredRuleByDefaultPlanItemControl

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testRequiredRuleByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(milestone, "ItemControl_1", DefaultControl.class);
  RequiredRule requiredRule = createElement(defaultControl, "RequiredRule_1", RequiredRule.class);
  ConditionExpression expression = createElement(requiredRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(discretionaryItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_REQUIRED_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:MilestoneDiscretionaryItemHandlerTest.java

示例13: testRequiredRule

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testRequiredRule() {
  // given
  ItemControl itemControl = createElement(planItem, "ItemControl_1", ItemControl.class);
  RequiredRule requiredRule = createElement(itemControl, "RequiredRule_1", RequiredRule.class);
  ConditionExpression expression = createElement(requiredRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_REQUIRED_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:MilestonePlanItemHandlerTest.java

示例14: testRequiredRuleByDefaultPlanItemControl

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testRequiredRuleByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(milestone, "ItemControl_1", DefaultControl.class);
  RequiredRule requiredRule = createElement(defaultControl, "RequiredRule_1", RequiredRule.class);
  ConditionExpression expression = createElement(requiredRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_REQUIRED_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:MilestonePlanItemHandlerTest.java

示例15: testRepetitionRule

import org.camunda.bpm.model.cmmn.Cmmn; //导入依赖的package包/类
@Test
public void testRepetitionRule() {
  // given
  ItemControl itemControl = createElement(planItem, "ItemControl_1", ItemControl.class);
  RepetitionRule repetitionRule = createElement(itemControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  Object rule = newActivity.getProperty(PROPERTY_REPETITION_RULE);
  assertNotNull(rule);
  assertTrue(rule instanceof CaseControlRule);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:MilestonePlanItemHandlerTest.java


注:本文中的org.camunda.bpm.model.cmmn.Cmmn类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。