use of org.drools.compiler.kie.builder.impl.InternalKieModule in project jbpm by kiegroup.
the class UserTaskInstanceWithPotOwnerTest method prepare.
@Before
public void prepare() {
System.setProperty("org.jbpm.ht.callback", "custom");
System.setProperty("org.jbpm.ht.custom.callback", "org.jbpm.kie.services.test.objects.TestUserGroupCallbackImpl");
this.dataSourceJNDIname = getDataSourceJNDI();
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/EmptyHumanTask.bpmn");
processes.add("repo/processes/general/humanTask.bpmn");
processes.add("repo/processes/general/BPMN2-UserTask.bpmn2");
processes.add("repo/processes/general/SimpleHTProcess.bpmn2");
processes.add("repo/processes/general/AdHocSubProcess.bpmn2");
processes.add("repo/processes/general/ExcludedOwner.bpmn2");
DeploymentDescriptor customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain");
customDescriptor.getBuilder().addRequiredRole("view:managers");
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);
assertNotNull(deploymentService);
deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(deploymentUnit);
units.add(deploymentUnit);
prepareJPAModule(ks, repository);
assertNotNull(processService);
}
use of org.drools.compiler.kie.builder.impl.InternalKieModule in project jbpm by kiegroup.
the class ProcessServiceImplWithDeploymentIdTest 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");
InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
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.drools.compiler.kie.builder.impl.InternalKieModule in project jbpm by kiegroup.
the class ProcessServiceWithEntitiesTest 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/entityprocessvar-process.bpmn2");
DeploymentDescriptorImpl customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain");
List<String> remotableClasses = java.util.Arrays.asList("example.CaseDetail", "org.drools.persistence.jpa.marshaller.MappedVariable");
customDescriptor.setClasses(remotableClasses);
List<ObjectModel> marshallingStrategies = new ArrayList<ObjectModel>();
marshallingStrategies.add(new ObjectModel("mvel", "new org.drools.persistence.jpa.marshaller.JPAPlaceholderResolverStrategy(\"org.jbpm.test:test-module:1.0.0-SNAPSHOT\", classLoader)"));
customDescriptor.setMarshallingStrategies(marshallingStrategies);
Map<String, String> extraResources = new HashMap<>();
extraResources.put(CASEDETAIL_JAVA, getCaseDetailEntitySource());
extraResources.put("src/main/resources/" + DeploymentDescriptor.META_INF_LOCATION, customDescriptor.toXml());
extraResources.put("src/main/resources/META-INF/persistence.xml", getPersistenceXml());
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) {
}
KieMavenRepository repository = getKieMavenRepository();
repository.deployArtifact(releaseId, kJar1, pom);
}
use of org.drools.compiler.kie.builder.impl.InternalKieModule in project jbpm by kiegroup.
the class ProcessServiceWithServiceRegistryTest 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/ServiceRegistryScriptTask.bpmn2");
InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
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);
deploymentService.deploy(deploymentUnit);
}
use of org.drools.compiler.kie.builder.impl.InternalKieModule in project jbpm by kiegroup.
the class QueryServiceImplTest method prepare.
@Before
public void prepare() {
System.setProperty("org.jbpm.ht.callback", "custom");
System.setProperty("org.jbpm.ht.custom.callback", "org.jbpm.kie.services.test.objects.TestUserGroupCallbackImpl");
this.dataSourceJNDIname = getDataSourceJNDI();
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/EmptyHumanTask.bpmn");
processes.add("repo/processes/general/humanTask.bpmn");
processes.add("repo/processes/general/BPMN2-UserTask.bpmn2");
processes.add("repo/processes/general/SimpleHTProcess.bpmn2");
processes.add("repo/processes/general/AdHocSubProcess.bpmn2");
processes.add("repo/processes/general/ExcludedOwner.bpmn2");
DeploymentDescriptor customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain");
customDescriptor.getBuilder().addRequiredRole("view:managers");
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);
assertNotNull(deploymentService);
deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(deploymentUnit);
units.add(deploymentUnit);
prepareJPAModule(ks, repository);
assertNotNull(processService);
}
Aggregations