use of org.jbpm.services.api.model.ProcessDefinition in project jbpm by kiegroup.
the class RuntimeDataServiceImplTest method testGetProcessesByDeploymentId.
@Test
public void testGetProcessesByDeploymentId() {
Collection<ProcessDefinition> definitions = runtimeDataService.getProcessesByDeploymentId(deploymentUnit.getIdentifier(), new QueryContext());
assertNotNull(definitions);
assertEquals(5, definitions.size());
List<String> expectedProcessIds = new ArrayList<String>();
expectedProcessIds.add("org.jbpm.writedocument.empty");
expectedProcessIds.add("org.jbpm.writedocument");
expectedProcessIds.add("UserTask");
expectedProcessIds.add("org.jboss.qa.bpms.HumanTask");
expectedProcessIds.add("AdHocSubProcess");
for (ProcessDefinition def : definitions) {
assertTrue(expectedProcessIds.contains(def.getId()));
}
String origVer = deploymentUnit.getVersion();
deploymentUnit.setVersion("LATEST");
definitions = runtimeDataService.getProcessesByDeploymentId(deploymentUnit.getIdentifier(), new QueryContext());
assertNotNull(definitions);
assertEquals(5, definitions.size());
deploymentUnit.setVersion(origVer);
}
use of org.jbpm.services.api.model.ProcessDefinition in project jbpm by kiegroup.
the class RuntimeDataServiceImplTest method testGetProcessesSortByProcessName.
@Test
public void testGetProcessesSortByProcessName() {
Collection<ProcessDefinition> definitions = runtimeDataService.getProcesses(new QueryContext("ProcessName", true));
assertNotNull(definitions);
assertEquals(5, definitions.size());
List<String> expectedProcessIds = new ArrayList<String>();
expectedProcessIds.add("AdHoc SubProcess");
expectedProcessIds.add("HumanTask");
expectedProcessIds.add("User Task");
expectedProcessIds.add("humanTaskSample");
expectedProcessIds.add("humanTaskSample");
int index = 0;
for (ProcessDefinition def : definitions) {
assertEquals(def.getName(), expectedProcessIds.get(index));
index++;
}
}
use of org.jbpm.services.api.model.ProcessDefinition in project jbpm by kiegroup.
the class RuntimeDataServiceImplTest method testGetProcessByFilter.
@Test
public void testGetProcessByFilter() {
Collection<ProcessDefinition> definitions = runtimeDataService.getProcessesByFilter("org.jbpm", new QueryContext());
assertNotNull(definitions);
assertEquals(2, definitions.size());
List<String> expectedProcessIds = new ArrayList<String>();
expectedProcessIds.add("org.jbpm.writedocument.empty");
expectedProcessIds.add("org.jbpm.writedocument");
for (ProcessDefinition def : definitions) {
assertTrue(expectedProcessIds.contains(def.getId()));
}
}
use of org.jbpm.services.api.model.ProcessDefinition in project jbpm by kiegroup.
the class RuntimeDataServiceImplTest method testGetProcesses.
@Test
public void testGetProcesses() {
Collection<ProcessDefinition> definitions = runtimeDataService.getProcesses(new QueryContext());
assertNotNull(definitions);
assertEquals(5, definitions.size());
List<String> expectedProcessIds = new ArrayList<String>();
expectedProcessIds.add("org.jbpm.writedocument.empty");
expectedProcessIds.add("org.jbpm.writedocument");
expectedProcessIds.add("UserTask");
expectedProcessIds.add("org.jboss.qa.bpms.HumanTask");
expectedProcessIds.add("AdHocSubProcess");
for (ProcessDefinition def : definitions) {
assertTrue(expectedProcessIds.contains(def.getId()));
}
}
use of org.jbpm.services.api.model.ProcessDefinition 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();
}
Aggregations