use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class KModuleDeploymentService method addClassToDeployedUnit.
protected void addClassToDeployedUnit(Class deploymentClass, DeployedUnitImpl deployedUnit) {
if (deploymentClass != null) {
DeploymentUnit unit = deployedUnit.getDeploymentUnit();
Boolean limitClasses = false;
if (unit != null) {
DeploymentDescriptor depDesc = ((KModuleDeploymentUnit) unit).getDeploymentDescriptor();
if (depDesc != null) {
limitClasses = depDesc.getLimitSerializationClasses();
}
}
if (limitClasses != null && limitClasses) {
filterClassesAddedToDeployedUnit(deployedUnit, deploymentClass);
} else {
logger.debug("Loaded {} onto the classpath from deployment {}", deploymentClass.getName(), unit.getIdentifier());
deployedUnit.addClass(deploymentClass);
}
}
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class EDefinitionTest method testAssociatedEntities.
@Test
public void testAssociatedEntities() {
DeploymentUnit basicKieJar = archive.deployBasicKieJar();
Map<String, Collection<String>> entities = definitionService.getAssociatedEntities(basicKieJar.getIdentifier(), HUMAN_TASK_PROCESS_ID);
Assertions.assertThat(entities).isNotNull().hasSize(1);
Assertions.assertThat(entities.get("Hello")).contains("ibek");
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class EDefinitionTest method testServiceTasks.
@Test
public void testServiceTasks() {
DeploymentUnit serviceKieJar = archive.deployServiceKieJar();
Map<String, String> services = definitionService.getServiceTasks(serviceKieJar.getIdentifier(), REST_WORK_ITEM_PROCESS_ID);
Assertions.assertThat(services).isNotNull().hasSize(1).containsEntry("Any REST operation", "Rest");
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class EDefinitionTest method testGetProcessDefinition.
@Test
public void testGetProcessDefinition() {
DeploymentUnit basicKieJar = archive.deployBasicKieJar();
ProcessDefinition pd = definitionService.getProcessDefinition(basicKieJar.getIdentifier(), HUMAN_TASK_PROCESS_ID);
Assertions.assertThat(pd).isNotNull();
System.out.println(pd.getId());
System.out.println(pd.getName());
System.out.println(pd.getKnowledgeType());
System.out.println(pd.getOriginalPath());
System.out.println(pd.getPackageName());
System.out.println(pd.getType());
System.out.println(pd.getVersion());
System.out.println(pd.getAssociatedEntities());
System.out.println(pd.getProcessVariables());
System.out.println(pd.getReusableSubProcesses());
System.out.println(pd.getServiceTasks());
Assertions.assertThat(pd.getId()).isNotNull().isEqualTo(HUMAN_TASK_PROCESS_ID);
Assertions.assertThat(pd.getName()).isNotNull().isEqualTo("HumanTask");
Assertions.assertThat(pd.getKnowledgeType()).isNotNull();
// Assertions.assertThat(pd.getOriginalPath()).isNotNull(); // Related to asset deployment
Assertions.assertThat(pd.getPackageName()).isNotNull();
Assertions.assertThat(pd.getType()).isNotNull();
Assertions.assertThat(pd.getVersion()).isNotNull();
Assertions.assertThat(pd.getAssociatedEntities()).isNotNull();
Assertions.assertThat(pd.getProcessVariables()).isNotNull();
Assertions.assertThat(pd.getReusableSubProcesses()).isNotNull();
Assertions.assertThat(pd.getServiceTasks()).isNotNull();
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class EDefinitionTest method testTasksDefinitions.
@Test
public void testTasksDefinitions() {
DeploymentUnit basicKieJar = archive.deployBasicKieJar();
Collection<UserTaskDefinition> tasks = definitionService.getTasksDefinitions(basicKieJar.getIdentifier(), HUMAN_TASK_PROCESS_ID);
Assertions.assertThat(tasks).isNotNull().hasSize(1);
UserTaskDefinition task = tasks.iterator().next();
Assertions.assertThat(task.getName()).isEqualTo("Hello");
Assertions.assertThat(task.getAssociatedEntities()).contains("ibek");
Assertions.assertThat(task.getTaskInputMappings()).containsEntry("TaskName", "java.lang.String");
}
Aggregations