本文整理汇总了Java中org.camunda.bpm.engine.repository.DeploymentBuilder类的典型用法代码示例。如果您正苦于以下问题:Java DeploymentBuilder类的具体用法?Java DeploymentBuilder怎么用?Java DeploymentBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeploymentBuilder类属于org.camunda.bpm.engine.repository包,在下文中一共展示了DeploymentBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deployTweakedModels
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
public String deployTweakedModels() {
LOG.info("Starting deployment of tweaked models for demo data generation");
try {
DeploymentBuilder deploymentBuilder = engine.getRepositoryService().createDeployment();
for (Entry<String, String> model : tweakedModels.entrySet()) {
deploymentBuilder.addInputStream(model.getKey(), new ByteArrayInputStream(model.getValue().getBytes("UTF-8")));
}
Deployment deployment = deploymentBuilder.deploy();
if (simulatingProcessApplication != null) {
engine.getManagementService().registerProcessApplication(deployment.getId(), simulatingProcessApplication);
}
LOG.info("Deployed tweaked modes for demo data generation with deployment " + deployment.getId());
return deployment.getId();
} catch (Exception ex) {
throw new RuntimeException("Could not deploy tweaked process definition", ex);
}
}
开发者ID:camunda-consulting,项目名称:camunda-util-demo-data-generator,代码行数:18,代码来源:DemoModelInstrumentator.java
示例2: restoreOriginalModels
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
public void restoreOriginalModels() {
LOG.info("Starting to restore models after demo data generation");
try {
DeploymentBuilder deploymentBuilder = engine.getRepositoryService().createDeployment();
for (Entry<String, String> model : originalModels.entrySet()) {
deploymentBuilder.addInputStream(model.getKey(), new ByteArrayInputStream(model.getValue().getBytes("UTF-8")));
}
Deployment deployment = deploymentBuilder.deploy();
if (originalProcessApplication != null) {
engine.getManagementService().registerProcessApplication(deployment.getId(), originalProcessApplication);
}
LOG.info("Restored original modes after demo data generation with deployment " + deployment.getId());
} catch (Exception ex) {
throw new RuntimeException("Could not restore original models", ex);
}
}
开发者ID:camunda-consulting,项目名称:camunda-util-demo-data-generator,代码行数:17,代码来源:DemoModelInstrumentator.java
示例3: deployProcessDefinitions
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Override
public void deployProcessDefinitions(String bundleSymbolicName, List<URL> pathList) {
try {
LOGGER.log(Level.FINE,
"Found process in bundle " + bundleSymbolicName
+ " with paths: " + pathList);
if (engine == null) {
throw new IllegalStateException(
"Unable to find a ProcessEngine service");
}
RepositoryService service = engine.getRepositoryService();
DeploymentBuilder builder = service.createDeployment();
builder.name(bundleSymbolicName);
for (URL url : pathList) {
InputStream is = url.openStream();
if (is == null) {
throw new IOException("Error opening url: " + url);
}
try {
builder.addInputStream(getPath(url), is);
} finally {
is.close();
}
}
builder.enableDuplicateFiltering(true);
builder.deploy();
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Unable to deploy bundle", e);
}
}
示例4: createDeployment
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Override
public void createDeployment(String processArchiveName, DeploymentBuilder deploymentBuilder) {
ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getProcessEngine("default");
// Hack: deploy the first version of the invoice process once before the process application
// is deployed the first time
if (processEngine != null) {
RepositoryService repositoryService = processEngine.getRepositoryService();
if (!isProcessDeployed(repositoryService, "invoice")) {
ClassLoader classLoader = getProcessApplicationClassloader();
repositoryService.createDeployment(this.getReference())
.addInputStream("invoice.v1.bpmn", classLoader.getResourceAsStream("invoice.v1.bpmn"))
.addInputStream("invoiceBusinessDecisions.dmn", classLoader.getResourceAsStream("invoiceBusinessDecisions.dmn"))
.addInputStream("review-invoice.cmmn", classLoader.getResourceAsStream("review-invoice.cmmn"))
.deploy();
}
}
}
示例5: testDeleteDeploymentSkipCustomListeners
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
public void testDeleteDeploymentSkipCustomListeners() {
DeploymentBuilder deploymentBuilder =
repositoryService
.createDeployment()
.addClasspathResource("org/camunda/bpm/engine/test/api/repository/RepositoryServiceTest.testDeleteProcessInstanceSkipCustomListeners.bpmn20.xml");
String deploymentId = deploymentBuilder.deploy().getId();
runtimeService.startProcessInstanceByKey("testProcess");
repositoryService.deleteDeployment(deploymentId, true, false);
assertEquals(1, TestExecutionListener.collectedEvents.size());
TestExecutionListener.reset();
deploymentId = deploymentBuilder.deploy().getId();
runtimeService.startProcessInstanceByKey("testProcess");
repositoryService.deleteDeployment(deploymentId, true, true);
assertTrue(TestExecutionListener.collectedEvents.isEmpty());
TestExecutionListener.reset();
}
示例6: testDeleteDeploymentSkipCustomTaskListeners
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
public void testDeleteDeploymentSkipCustomTaskListeners() {
DeploymentBuilder deploymentBuilder =
repositoryService
.createDeployment()
.addClasspathResource("org/camunda/bpm/engine/test/api/repository/RepositoryServiceTest.testDeleteProcessInstanceSkipCustomTaskListeners.bpmn20.xml");
String deploymentId = deploymentBuilder.deploy().getId();
runtimeService.startProcessInstanceByKey("testProcess");
RecorderTaskListener.getRecordedEvents().clear();
repositoryService.deleteDeployment(deploymentId, true, false);
assertEquals(1, RecorderTaskListener.getRecordedEvents().size());
RecorderTaskListener.clear();
deploymentId = deploymentBuilder.deploy().getId();
runtimeService.startProcessInstanceByKey("testProcess");
repositoryService.deleteDeployment(deploymentId, true, true);
assertTrue(RecorderTaskListener.getRecordedEvents().isEmpty());
RecorderTaskListener.clear();
}
示例7: testDeleteDeploymentWithoutSkipIoMappings
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
public void testDeleteDeploymentWithoutSkipIoMappings() {
DeploymentBuilder deploymentBuilder = repositoryService.createDeployment()
.addClasspathResource("org/camunda/bpm/engine/test/api/repository/RepositoryServiceTest.testDeleteDeploymentSkipIoMappings.bpmn20.xml");
String deploymentId = deploymentBuilder.deploy().getId();
runtimeService.startProcessInstanceByKey("ioMappingProcess");
// Try to delete the deployment
try {
repositoryService.deleteDeployment(deploymentId, true, false, false);
fail("Exception expected");
} catch (Exception e) {
// Exception expected when deleting deployment with running process
// assert (e.getMessage().contains("Exception when output mapping is executed"));
assertTextPresent("Exception when output mapping is executed", e.getMessage());
}
repositoryService.deleteDeployment(deploymentId, true, false, true);
}
示例8: shouldPropagateTenantIdToCandidateStarterUser
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Test
public void shouldPropagateTenantIdToCandidateStarterUser() {
// when
DeploymentBuilder builder = repositoryService.createDeployment()
.addClasspathResource(CANDIDATE_STARTER_USER)
.tenantId(TENANT_ONE);
testRule.deploy(builder);
// then
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
assertEquals(1, links.size());
IdentityLink link = links.get(0);
assertNotNull(link.getTenantId());
assertEquals(TENANT_ONE, link.getTenantId());
}
示例9: shouldPropagateTenantIdToCandidateStarterUsers
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Test
public void shouldPropagateTenantIdToCandidateStarterUsers() {
// when
DeploymentBuilder builder = repositoryService.createDeployment()
.addClasspathResource(CANDIDATE_STARTER_USERS)
.tenantId(TENANT_ONE);
testRule.deploy(builder);
// then
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
assertEquals(3, links.size());
for (IdentityLink link : links) {
assertNotNull(link.getTenantId());
assertEquals(TENANT_ONE, link.getTenantId());
}
}
示例10: shouldPropagateTenantIdToCandidateStarterGroup
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Test
public void shouldPropagateTenantIdToCandidateStarterGroup() {
// when
DeploymentBuilder builder = repositoryService.createDeployment()
.addClasspathResource(CANDIDATE_STARTER_GROUP)
.tenantId(TENANT_ONE);
testRule.deploy(builder);
// then
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
assertEquals(1, links.size());
IdentityLink link = links.get(0);
assertNotNull(link.getTenantId());
assertEquals(TENANT_ONE, link.getTenantId());
}
示例11: shouldPropagateTenantIdToCandidateStarterGroups
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Test
public void shouldPropagateTenantIdToCandidateStarterGroups() {
// when
DeploymentBuilder builder = repositoryService.createDeployment()
.addClasspathResource(CANDIDATE_STARTER_GROUPS)
.tenantId(TENANT_ONE);
testRule.deploy(builder);
// then
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
assertEquals(3, links.size());
for (IdentityLink link : links) {
assertNotNull(link.getTenantId());
assertEquals(TENANT_ONE, link.getTenantId());
}
}
示例12: testCreateJobDefinitionWithParseListener
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Test
public void testCreateJobDefinitionWithParseListener() {
//given
String modelFileName = "jobCreationWithinParseListener.bpmn20.xml";
InputStream in = JobDefinitionCreationWithParseListenerTest.class.getResourceAsStream(modelFileName);
DeploymentBuilder builder = engineRule.getRepositoryService().createDeployment().addInputStream(modelFileName, in);
//when the asyncBefore is set in the parse listener
Deployment deployment = builder.deploy();
engineRule.manageDeployment(deployment);
//then there exists a new job definition
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
JobDefinition jobDef = query.singleResult();
assertNotNull(jobDef);
assertEquals(jobDef.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(jobDef.getActivityId(), "servicetask1");
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:JobDefinitionCreationWithParseListenerTest.java
示例13: testCreateJobDefinitionWithParseListenerAndAsyncInXml
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Test
public void testCreateJobDefinitionWithParseListenerAndAsyncInXml() {
//given the asyncBefore is set in the xml
String modelFileName = "jobAsyncBeforeCreationWithinParseListener.bpmn20.xml";
InputStream in = JobDefinitionCreationWithParseListenerTest.class.getResourceAsStream(modelFileName);
DeploymentBuilder builder = engineRule.getRepositoryService().createDeployment().addInputStream(modelFileName, in);
//when the asyncBefore is set in the parse listener
Deployment deployment = builder.deploy();
engineRule.manageDeployment(deployment);
//then there exists only one job definition
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
JobDefinition jobDef = query.singleResult();
assertNotNull(jobDef);
assertEquals(jobDef.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(jobDef.getActivityId(), "servicetask1");
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:JobDefinitionCreationWithParseListenerTest.java
示例14: testDeleteNonExistingAndCreateNewJobDefinitionWithParseListener
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Test
public void testDeleteNonExistingAndCreateNewJobDefinitionWithParseListener() {
//given
String modelFileName = "jobCreationWithinParseListener.bpmn20.xml";
InputStream in = JobDefinitionCreationWithParseListenerTest.class.getResourceAsStream(modelFileName);
DeploymentBuilder builder = engineRule.getRepositoryService().createDeployment().addInputStream(modelFileName, in);
//when the asyncBefore is set to false and the asyncAfter to true in the parse listener
Deployment deployment = builder.deploy();
engineRule.manageDeployment(deployment);
//then there exists one job definition
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
JobDefinition jobDef = query.singleResult();
assertNotNull(jobDef);
assertEquals(jobDef.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(jobDef.getActivityId(), "servicetask1");
assertEquals(jobDef.getJobConfiguration(), MessageJobDeclaration.ASYNC_AFTER);
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:JobDefinitionCreationAndDeletionWithParseListenerTest.java
示例15: testDeleteJobDefinitionWithParseListenerAndAsyncInXml
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Test
public void testDeleteJobDefinitionWithParseListenerAndAsyncInXml() {
//given the asyncBefore is set in the xml
String modelFileName = "jobAsyncBeforeCreationWithinParseListener.bpmn20.xml";
InputStream in = JobDefinitionCreationWithParseListenerTest.class.getResourceAsStream(modelFileName);
DeploymentBuilder builder = engineRule.getRepositoryService().createDeployment().addInputStream(modelFileName, in);
//when the asyncBefore is set to false and the asyncAfter to true in the parse listener
Deployment deployment = builder.deploy();
engineRule.manageDeployment(deployment);
//then there exists one job definition
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
JobDefinition jobDef = query.singleResult();
assertNotNull(jobDef);
assertEquals(jobDef.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(jobDef.getActivityId(), "servicetask1");
assertEquals(jobDef.getJobConfiguration(), MessageJobDeclaration.ASYNC_AFTER);
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:JobDefinitionCreationAndDeletionWithParseListenerTest.java