Search in sources :

Example 16 with DeploymentDescriptorImpl

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);
    }
}
Also used : DeploymentDescriptor(org.kie.internal.runtime.conf.DeploymentDescriptor) DeploymentDescriptorImpl(org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl) TransientNamedObjectModel(org.jbpm.runtime.manager.impl.deploy.TransientNamedObjectModel)

Example 17 with DeploymentDescriptorImpl

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);
}
Also used : ObjectModel(org.kie.internal.runtime.conf.ObjectModel) HashMap(java.util.HashMap) DeploymentDescriptor(org.kie.internal.runtime.conf.DeploymentDescriptor) ArrayList(java.util.ArrayList) DeploymentDescriptorImpl(org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl) KieServices(org.kie.api.KieServices) ReleaseId(org.kie.api.builder.ReleaseId) FileOutputStream(java.io.FileOutputStream) KieMavenRepository.getKieMavenRepository(org.kie.scanner.KieMavenRepository.getKieMavenRepository) KieMavenRepository(org.kie.scanner.KieMavenRepository) File(java.io.File) InternalKieModule(org.drools.compiler.kie.builder.impl.InternalKieModule) Before(org.junit.Before)

Example 18 with DeploymentDescriptorImpl

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;
}
Also used : ObjectModel(org.kie.internal.runtime.conf.ObjectModel) DeploymentDescriptor(org.kie.internal.runtime.conf.DeploymentDescriptor) DeploymentDescriptorImpl(org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit)

Example 19 with DeploymentDescriptorImpl

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);
}
Also used : HashMap(java.util.HashMap) DeploymentDescriptor(org.kie.internal.runtime.conf.DeploymentDescriptor) ArrayList(java.util.ArrayList) DeploymentDescriptorImpl(org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl) KieServices(org.kie.api.KieServices) ReleaseId(org.kie.api.builder.ReleaseId) DeploymentDescriptorBuilder(org.kie.internal.runtime.conf.DeploymentDescriptorBuilder) ProcessInstanceNotFoundException(org.jbpm.services.api.ProcessInstanceNotFoundException) FileOutputStream(java.io.FileOutputStream) KieMavenRepository.getKieMavenRepository(org.kie.scanner.KieMavenRepository.getKieMavenRepository) KieMavenRepository(org.kie.scanner.KieMavenRepository) File(java.io.File) InternalKieModule(org.drools.compiler.kie.builder.impl.InternalKieModule) Before(org.junit.Before)

Example 20 with DeploymentDescriptorImpl

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);
}
Also used : Building(org.jbpm.kie.test.objects.Building) DeploymentDescriptor(org.kie.internal.runtime.conf.DeploymentDescriptor) OtherPerson(org.jbpm.kie.test.objects.OtherPerson) DeploymentDescriptorImpl(org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl) House(org.jbpm.kie.test.objects.House) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) Person(org.jbpm.kie.test.objects.Person) OtherPerson(org.jbpm.kie.test.objects.OtherPerson) Thing(org.jbpm.kie.test.objects.Thing) AbstractKieServicesBaseTest(org.jbpm.kie.test.util.AbstractKieServicesBaseTest) Test(org.junit.Test)

Aggregations

DeploymentDescriptorImpl (org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl)27 DeploymentDescriptor (org.kie.internal.runtime.conf.DeploymentDescriptor)26 KModuleDeploymentUnit (org.jbpm.kie.services.impl.KModuleDeploymentUnit)19 KieServices (org.kie.api.KieServices)15 ReleaseId (org.kie.api.builder.ReleaseId)15 File (java.io.File)14 InternalKieModule (org.drools.compiler.kie.builder.impl.InternalKieModule)14 HashMap (java.util.HashMap)13 FileOutputStream (java.io.FileOutputStream)12 KieMavenRepository (org.kie.scanner.KieMavenRepository)12 KieMavenRepository.getKieMavenRepository (org.kie.scanner.KieMavenRepository.getKieMavenRepository)12 ArrayList (java.util.ArrayList)11 Test (org.junit.Test)11 AbstractKieServicesBaseTest (org.jbpm.kie.test.util.AbstractKieServicesBaseTest)9 Before (org.junit.Before)8 DeployedUnit (org.jbpm.services.api.model.DeployedUnit)7 NamedObjectModel (org.kie.internal.runtime.conf.NamedObjectModel)7 ObjectModel (org.kie.internal.runtime.conf.ObjectModel)7 ProcessInstanceNotFoundException (org.jbpm.services.api.ProcessInstanceNotFoundException)6 ProcessInstance (org.kie.api.runtime.process.ProcessInstance)5