use of org.jboss.qa.bpms.remote.ejb.domain.Person in project jbpm by kiegroup.
the class ECustomVariableTest method testCustomProcessVariableRetrieval.
@Test
public void testCustomProcessVariableRetrieval() {
Person candidate = new Person("Dluhoslav Chudobny", 30);
Map<String, Object> parameters = new HashMap<>();
parameters.put("candidate", candidate);
Long pid = ejb.startProcess(ProcessDefinitions.CUSTOM_VARIABLE, parameters);
Person person = (Person) ejb.getProcessVariable(pid, "candidate");
Assertions.assertThat(person).isNotNull().isEqualTo(candidate);
}
use of org.jboss.qa.bpms.remote.ejb.domain.Person in project jbpm by kiegroup.
the class ETaskAttachmentTest method testCustomAttachment.
@Test
public void testCustomAttachment() throws IOException {
ejb.startProcess(ProcessDefinitions.HUMAN_TASK);
List<TaskSummary> taskSummaryList = ejb.getTasksAssignedAsPotentialOwner(userId);
Long taskId = taskSummaryList.get(0).getId();
// Add attachment
Person lisa = new Person("Lisa Simpson", 7);
ejb.addAttachment(taskId, userId, "Lisa", lisa);
// Get the attachment
Attachment attachment = getAttachment(taskId);
Assertions.assertThat(attachment.getContentType()).isEqualTo(lisa.getClass().getName());
Assertions.assertThat(attachment.getSize()).isEqualTo(persist(lisa).length);
// Get the attachment content
Object content = getContent(taskId, attachment.getId());
Assertions.assertThat(content).isEqualTo(lisa);
}
use of org.jboss.qa.bpms.remote.ejb.domain.Person in project jbpm by kiegroup.
the class ECustomVariableTest method testCustomProcessVariableSet.
@Test
public void testCustomProcessVariableSet() {
Person candidate = new Person("Jack Sparrow", 35);
Map<String, Object> parameters = new HashMap<>();
parameters.put("candidate", candidate);
Long pid = ejb.startProcess(ProcessDefinitions.CUSTOM_VARIABLE, parameters);
Person betterCandidate = new Person("Barbossa", 53);
ejb.setProcessVariable(pid, "candidate", betterCandidate);
Person person = (Person) ejb.getProcessVariable(pid, "candidate");
Assertions.assertThat(person).isNotNull().isEqualTo(betterCandidate);
}
Aggregations