本文整理汇总了Java中org.camunda.bpm.engine.repository.DeploymentBuilder类的典型用法代码示例。如果您正苦于以下问题:Java DeploymentBuilder类的具体用法?Java DeploymentBuilder怎么用?Java DeploymentBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeploymentBuilder类属于org.camunda.bpm.engine.repository包,在下文中一共展示了DeploymentBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:camunda,项目名称:camunda-bpm-platform-osgi,代码行数:33,代码来源:ProcessDefinitionDeployerImpl.java
示例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();
}
}
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:InvoiceProcessApplication.java
示例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();
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:RepositoryServiceTest.java
示例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();
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:RepositoryServiceTest.java
示例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);
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:RepositoryServiceTest.java
示例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());
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:ProcessDefinitionCandidateTest.java
示例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());
}
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:ProcessDefinitionCandidateTest.java
示例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());
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:ProcessDefinitionCandidateTest.java
示例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());
}
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:ProcessDefinitionCandidateTest.java
示例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
示例16: testDeleteJobDefinitionWithParseListenerAndAsyncBothInXml
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
@Test
public void testDeleteJobDefinitionWithParseListenerAndAsyncBothInXml() {
//given the asyncBefore AND asyncAfter is set in the xml
String modelFileName = "jobAsyncBothCreationWithinParseListener.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
示例17: tryToRedeploy
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
protected DeploymentWithDefinitions tryToRedeploy(RedeploymentDto redeployment) {
RepositoryService repositoryService = getProcessEngine().getRepositoryService();
DeploymentBuilder builder = repositoryService.createDeployment();
builder.nameFromDeployment(deploymentId);
String tenantId = getDeployment().getTenantId();
if (tenantId != null) {
builder.tenantId(tenantId);
}
if (redeployment != null) {
builder = addRedeploymentResources(builder, redeployment);
} else {
builder.addDeploymentResources(deploymentId);
}
return builder.deployWithResult();
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:DeploymentResourceImpl.java
示例18: addRedeploymentResources
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
protected DeploymentBuilder addRedeploymentResources(DeploymentBuilder builder, RedeploymentDto redeployment) {
builder.source(redeployment.getSource());
List<String> resourceIds = redeployment.getResourceIds();
List<String> resourceNames = redeployment.getResourceNames();
boolean isResourceIdListEmpty = resourceIds == null || resourceIds.isEmpty();
boolean isResourceNameListEmpty = resourceNames == null || resourceNames.isEmpty();
if (isResourceIdListEmpty && isResourceNameListEmpty) {
builder.addDeploymentResources(deploymentId);
} else {
if (!isResourceIdListEmpty) {
builder.addDeploymentResourcesById(deploymentId, resourceIds);
}
if (!isResourceNameListEmpty) {
builder.addDeploymentResourcesByName(deploymentId, resourceNames);
}
}
return builder;
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:DeploymentResourceImpl.java
示例19: deployProcessWithMissingServiceClass
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
/**
* Test to deploy a process with a missing service class.
* <p>
* This test is expected to throw an exception. It does not use the @Deployment annotation
* because the exception would be thrown outside the test in this case.
* </p>
*/
@Test(expected = ProcessEngineException.class)
public void deployProcessWithMissingServiceClass() {
DeploymentBuilder deploymentBuilder = rule.getRepositoryService().createDeployment()
.name(ClassNameUtil.getClassNameWithoutPackage(BpmValidationIT.class) + "."
+ "deployProcessWithMissingServiceClass");
deploymentBuilder.addClasspathResource("bpmn/process-with-missing-servicetask-class.bpmn");
deploymentBuilder.deploy().getId();
}
开发者ID:FrVaBe,项目名称:camunda,代码行数:16,代码来源:BpmValidationIT.java
示例20: deploy
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入依赖的package包/类
/**
* Checks deployment of the process definition.
*
* @param processModelResources
* process definition file (BPMN)
*/
public void deploy(final String... processModelResources) {
final DeploymentBuilder deploymentBuilder = this.processEngine.getRepositoryService().createDeployment();
for (final String resource : processModelResources) {
deploymentBuilder.addClasspathResource(resource);
}
this.deploymentIds.add(deploymentBuilder.deploy().getId());
getStartTime();
}
开发者ID:camunda,项目名称:camunda-bpm-jbehave,代码行数:15,代码来源:CamundaSupport.java
注:本文中的org.camunda.bpm.engine.repository.DeploymentBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论