Exemplo n.º 1
0
 private void triggerStartOfTask() throws Exception {
   getPersistence().start();
   housePlan = getPersistence().find(HousePlan.class, housePlan.getId());
   new WallPlan(housePlan);
   getPersistence().update(housePlan);
   getPersistence().commit();
 }
Exemplo n.º 2
0
 @Test
 public void testTaskInputParameters() throws Exception {
   // *****GIVEN
   givenThatTheTestCaseIsStarted();
   // *****WHEN
   triggerStartOfTask();
   // *****THEN
   assertNodeTriggered(caseInstance.getId(), "TheTask");
   List<TaskSummary> list =
       getRuntimeEngine().getTaskService().getTasksAssignedAsPotentialOwner("Builder", "en-UK");
   assertEquals(1, list.size());
   Task task = getRuntimeEngine().getTaskService().getTaskById(list.get(0).getId());
   Content input =
       getRuntimeEngine()
           .getTaskService()
           .getContentById(task.getTaskData().getDocumentContentId());
   getPersistence().start();
   @SuppressWarnings("unchecked")
   Map<String, Object> contentData =
       (Map<String, Object>)
           ContentMarshallerHelper.unmarshall(
               input.getContent(), getRuntimeEngine().getKieSession().getEnvironment());
   assertEquals(
       housePlan.getWallPlans().iterator().next().getId(),
       ((WallPlan) contentData.get("wallPlan")).getId());
   getPersistence().commit();
 }