本文整理汇总了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);
}
}
}
示例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
}
}
示例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
}
}
示例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;
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}