use of org.kie.scanner.KieMavenRepository in project jbpm by kiegroup.
the class TaskVariablesQueryServiceTest method prepare.
@Before
public void prepare() {
configureServices();
KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION);
File kjar = new File("src/test/resources/kjar-task-vars/task-vars-1.0.jar");
File pom = new File("src/test/resources/kjar-task-vars/pom.xml");
KieMavenRepository repository = getKieMavenRepository();
repository.installArtifact(releaseId, kjar, pom);
ReleaseId releaseIdSales = ks.newReleaseId("org.jbpm.test", "product-sale", "1.0");
File kjarSales = new File("src/test/resources/kjar-sales/product-sale-1.0.jar");
File pomSales = new File("src/test/resources/kjar-sales/pom.xml");
repository.installArtifact(releaseIdSales, kjarSales, pomSales);
assertNotNull(deploymentService);
KModuleDeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(deploymentUnit);
KModuleDeploymentUnit deploymentUnitSales = new KModuleDeploymentUnit(SALES_GROUP_ID, SALES_ARTIFACT_ID, SALES_VERSION);
DeploymentDescriptor customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain");
customDescriptor.getBuilder().addMarshalingStrategy(new ObjectModel("mvel", "new org.drools.persistence.jpa.marshaller.JPAPlaceholderResolverStrategy(\"org.jbpm.test:product-sale:1.0\", classLoader)"));
// disable below line to avoid jpa marshaling of ProductSale variable
deploymentUnitSales.setDeploymentDescriptor(customDescriptor);
deploymentService.deploy(deploymentUnitSales);
deploymentUnitSalesId = deploymentUnitSales.getIdentifier();
DeployedUnit deployed = deploymentService.getDeployedUnit(deploymentUnit.getIdentifier());
assertNotNull(deployed);
assertNotNull(deployed.getDeploymentUnit());
assertNotNull(runtimeDataService);
Collection<ProcessDefinition> processes = runtimeDataService.getProcesses(new QueryContext());
assertNotNull(processes);
assertEquals(2, processes.size());
deploymentUnitId = deploymentUnit.getIdentifier();
}
use of org.kie.scanner.KieMavenRepository 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.kie.scanner.KieMavenRepository 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.kie.scanner.KieMavenRepository 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.kie.scanner.KieMavenRepository 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);
}
Aggregations