本文整理汇总了Java中org.camunda.bpm.engine.repository.DeploymentBuilder.deploy方法的典型用法代码示例。如果您正苦于以下问题:Java DeploymentBuilder.deploy方法的具体用法?Java DeploymentBuilder.deploy怎么用?Java DeploymentBuilder.deploy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.repository.DeploymentBuilder
的用法示例。
在下文中一共展示了DeploymentBuilder.deploy方法的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: 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
示例5: 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
示例6: 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
示例7: 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
示例8: 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
示例9: testCreateBothAsyncJobDefinitionWithParseListener
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入方法依赖的package包/类
@Test
public void testCreateBothAsyncJobDefinitionWithParseListener() {
//given
String modelFileName = "jobCreationWithinParseListener.bpmn20.xml";
InputStream in = JobDefinitionCreationWithParseListenerTest.class.getResourceAsStream(modelFileName);
DeploymentBuilder builder = engineRule.getRepositoryService().createDeployment().addInputStream(modelFileName, in);
//when the asyncBefore and asyncAfter is set to true in the parse listener
Deployment deployment = builder.deploy();
engineRule.manageDeployment(deployment);
//then there exists two job definitions
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
List<JobDefinition> definitions = query.orderByJobConfiguration().asc().list();
assertEquals(definitions.size(), 2);
//asyncAfter
JobDefinition asyncAfterAfter = definitions.get(0);
assertEquals(asyncAfterAfter.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(asyncAfterAfter.getActivityId(), "servicetask1");
assertEquals(asyncAfterAfter.getJobConfiguration(), MessageJobDeclaration.ASYNC_AFTER);
//asyncBefore
JobDefinition asyncAfterBefore = definitions.get(1);
assertEquals(asyncAfterBefore.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(asyncAfterBefore.getActivityId(), "servicetask1");
assertEquals(asyncAfterBefore.getJobConfiguration(), MessageJobDeclaration.ASYNC_BEFORE);
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:29,代码来源:JobDefinitionCreationBothAsyncWithParseListenerTest.java
示例10: testCreateBothJobDefinitionWithParseListenerAndAsyncBeforeInXml
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入方法依赖的package包/类
@Test
public void testCreateBothJobDefinitionWithParseListenerAndAsyncBeforeInXml() {
//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 and asyncAfter is set to true in the parse listener
Deployment deployment = builder.deploy();
engineRule.manageDeployment(deployment);
//then there exists two job definitions
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
List<JobDefinition> definitions = query.orderByJobConfiguration().asc().list();
assertEquals(definitions.size(), 2);
//asyncAfter
JobDefinition asyncAfterAfter = definitions.get(0);
assertEquals(asyncAfterAfter.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(asyncAfterAfter.getActivityId(), "servicetask1");
assertEquals(asyncAfterAfter.getJobConfiguration(), MessageJobDeclaration.ASYNC_AFTER);
//asyncBefore
JobDefinition asyncAfterBefore = definitions.get(1);
assertEquals(asyncAfterBefore.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(asyncAfterBefore.getActivityId(), "servicetask1");
assertEquals(asyncAfterBefore.getJobConfiguration(), MessageJobDeclaration.ASYNC_BEFORE);
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:29,代码来源:JobDefinitionCreationBothAsyncWithParseListenerTest.java
示例11: testCreateBothJobDefinitionWithParseListenerAndAsynBothInXml
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入方法依赖的package包/类
@Test
public void testCreateBothJobDefinitionWithParseListenerAndAsynBothInXml() {
//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 and asyncAfter is set to true in the parse listener
Deployment deployment = builder.deploy();
engineRule.manageDeployment(deployment);
//then there exists two job definitions
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
List<JobDefinition> definitions = query.orderByJobConfiguration().asc().list();
assertEquals(definitions.size(), 2);
//asyncAfter
JobDefinition asyncAfterAfter = definitions.get(0);
assertEquals(asyncAfterAfter.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(asyncAfterAfter.getActivityId(), "servicetask1");
assertEquals(asyncAfterAfter.getJobConfiguration(), MessageJobDeclaration.ASYNC_AFTER);
//asyncBefore
JobDefinition asyncAfterBefore = definitions.get(1);
assertEquals(asyncAfterBefore.getProcessDefinitionKey(), "oneTaskProcess");
assertEquals(asyncAfterBefore.getActivityId(), "servicetask1");
assertEquals(asyncAfterBefore.getJobConfiguration(), MessageJobDeclaration.ASYNC_BEFORE);
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:29,代码来源:JobDefinitionCreationBothAsyncWithParseListenerTest.java
示例12: testDeleteNonExistingJobDefinitionWithParseListener
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入方法依赖的package包/类
@Test
public void testDeleteNonExistingJobDefinitionWithParseListener() {
//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 in the parse listener
Deployment deployment = builder.deploy();
engineRule.manageDeployment(deployment);
//then there exists no job definition
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
assertNull(query.singleResult());
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:JobDefinitionDeletionWithParseListenerTest.java
示例13: 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 in the parse listener
Deployment deployment = builder.deploy();
engineRule.manageDeployment(deployment);
//then there exists no job definition
JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
assertNull(query.singleResult());
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:JobDefinitionDeletionWithParseListenerTest.java
示例14: testParseExternalTaskWithoutTopic
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入方法依赖的package包/类
public void testParseExternalTaskWithoutTopic() {
DeploymentBuilder deploymentBuilder = repositoryService
.createDeployment()
.addClasspathResource("org/camunda/bpm/engine/test/bpmn/external/ExternalTaskParseTest.testParseExternalTaskWithoutTopic.bpmn20.xml");
try {
deploymentBuilder.deploy();
fail("exception expected");
} catch (ProcessEngineException e) {
assertTextPresent("External tasks must specify a 'topic' attribute in the camunda namespace", e.getMessage());
}
}
示例15: deploy
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入方法依赖的package包/类
public void deploy() {
DeploymentBuilder deploymentBuilder = repositoryService.createDeployment()
.source(source);
models.forEach(model -> deploymentBuilder.addModelInstance(resourceId(model), model));
deployment = deploymentBuilder.deploy();
}