use of org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl in project jbpm by kiegroup.
the class DeploymentServiceEJBImpl method addAsyncHandler.
protected void addAsyncHandler(KModuleDeploymentUnit unit) {
// add async only when the executor component is not disabled
if (isExecutorAvailable) {
DeploymentDescriptor descriptor = unit.getDeploymentDescriptor();
if (descriptor == null) {
descriptor = new DeploymentDescriptorImpl("org.jbpm.domain");
}
descriptor.getBuilder().addWorkItemHandler(new TransientNamedObjectModel("ejb", "async", "org.jbpm.executor.impl.wih.AsyncWorkItemHandler", new Object[] { EXECUTOR_EJB_JNDI_NAME, "org.jbpm.executor.commands.PrintOutCommand" }));
unit.setDeploymentDescriptor(descriptor);
}
}
use of org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl in project jbpm by kiegroup.
the class SupportProcessBaseTest method prepare.
@Before
public void prepare() {
KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION);
List<String> processes = new ArrayList<String>();
processes.add("repo/processes/support/support.bpmn");
DeploymentDescriptor customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain");
customDescriptor.getBuilder().addTaskEventListener(new ObjectModel("org.jbpm.services.cdi.test.ext.DebugTaskLifeCycleEventListener"));
Map<String, String> resources = new HashMap<String, String>();
resources.put("src/main/resources/" + DeploymentDescriptor.META_INF_LOCATION, customDescriptor.toXml());
InternalKieModule kJar1 = createKieJar(ks, releaseId, processes, resources);
File pom = new File("target/kmodule", "pom.xml");
pom.getParentFile().mkdir();
try {
FileOutputStream fs = new FileOutputStream(pom);
fs.write(getPom(releaseId).getBytes());
fs.close();
} catch (Exception e) {
}
KieMavenRepository repository = getKieMavenRepository();
repository.deployArtifact(releaseId, kJar1, pom);
}
use of org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl in project jbpm by kiegroup.
the class CaseCommentNotificationTest method prepareDeploymentUnit.
protected DeploymentUnit prepareDeploymentUnit() {
assertThat(deploymentService).isNotNull();
KModuleDeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
final DeploymentDescriptor descriptor = new DeploymentDescriptorImpl();
descriptor.getBuilder().addEventListener(new ObjectModel("mvel", "new org.jbpm.kie.services.impl.IdentityProviderAwareProcessListener(ksession)")).addEventListener(new ObjectModel("mvel", "org.jbpm.casemgmt.impl.util.CommentNotificationEventListenerFactory.get(\"test\")"));
deploymentUnit.setDeploymentDescriptor(descriptor);
deploymentUnit.setStrategy(RuntimeStrategy.PER_CASE);
deploymentService.deploy(deploymentUnit);
return deploymentUnit;
}
use of org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl in project jbpm by kiegroup.
the class ProcessServiceImplWithoutAuditTest method prepare.
@Before
public void prepare() {
configureServices();
logger.debug("Preparing kjar");
KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION);
List<String> processes = new ArrayList<String>();
processes.add("repo/processes/general/customtask.bpmn");
processes.add("repo/processes/general/humanTask.bpmn");
processes.add("repo/processes/general/import.bpmn");
processes.add("repo/processes/general/signal.bpmn");
processes.add("repo/processes/general/signalWithExpression.bpmn2");
processes.add("repo/processes/general/callactivity.bpmn");
DeploymentDescriptor customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain");
DeploymentDescriptorBuilder ddBuilder = customDescriptor.getBuilder();
ddBuilder.auditMode(AuditMode.NONE);
Map<String, String> extraResources = new HashMap<String, String>();
extraResources.put("src/main/resources/" + DeploymentDescriptor.META_INF_LOCATION, customDescriptor.toXml());
InternalKieModule kJar1 = createKieJar(ks, releaseId, processes, extraResources);
File pom = new File("target/kmodule", "pom.xml");
pom.getParentFile().mkdir();
try {
FileOutputStream fs = new FileOutputStream(pom);
fs.write(getPom(releaseId).getBytes());
fs.close();
} catch (Exception e) {
throw new RuntimeException("Unable to save pom content", e);
}
KieMavenRepository repository = getKieMavenRepository();
repository.deployArtifact(releaseId, kJar1, pom);
}
use of org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl in project jbpm by kiegroup.
the class FilteredKModuleDeploymentServiceTest method testSerializationClassesLimitedInDeploymentItself.
@Test
public void testSerializationClassesLimitedInDeploymentItself() {
String groupId = "org.test";
String artifactId = "jbpm-kie-services-filter-test";
String version = VERSION;
FluentKieModuleDeploymentHelper.newFluentInstance().setGroupId(groupId).setArtifactId(artifactId).setVersion(version).addClass(Building.class, House.class, Person.class, OtherPerson.class, Thing.class).createKieJarAndDeployToMaven();
KModuleDeploymentUnit limitDeploymentUnit = new KModuleDeploymentUnit(groupId, artifactId, version);
FluentKieModuleDeploymentHelper.newFluentInstance().setGroupId(groupId).setArtifactId(artifactId + "-all").setVersion(version).addClass(Building.class, House.class, Person.class, OtherPerson.class, Thing.class).createKieJarAndDeployToMaven();
KModuleDeploymentUnit allDeploymentUnit = new KModuleDeploymentUnit(groupId, artifactId + "-all", version);
configureServices();
DeploymentDescriptor depDesc = new DeploymentDescriptorImpl().getBuilder().setLimitSerializationClasses(true).get();
limitDeploymentUnit.setDeploymentDescriptor(depDesc);
deploymentService.deploy(limitDeploymentUnit);
verifyDeployedUnitContainsCorrectClasses(limitDeploymentUnit);
depDesc = new DeploymentDescriptorImpl().getBuilder().setLimitSerializationClasses(false).get();
allDeploymentUnit.setDeploymentDescriptor(depDesc);
deploymentService.deploy(allDeploymentUnit);
verifyDeployedUnitContainsCorrectClasses(allDeploymentUnit);
}
Aggregations