4 Replies Latest reply on Jan 24, 2013 9:59 AM by bennixview

    Dynamic Task UI via HornetQ

    bennixview Newbie



      i want to show dynamic HumanTask UI in my App via HornetQ.

      For Test I have a simple Process with one HT. inputData String userID , String reason. outputData Boolean acceptedOut. The User have to check a checkBox to set the Variable acceptedOut to true.

      Now I want to retrieve the input / output Data to build a generic UI.

      For that i read the Task via HornetQ TaskService and read the DocumentConten like this:


      long contentId = task1.getTaskData().getDocumentContentId();

      Content content = client.getContent(contentId);

      Object unmarshalledObject = ContentMarshallerHelper.unmarshall(content.getContent(), null);


      Now i've got the inputData. But i can't get the outputData. The ...getTaskData().getOutputContentId() is still -1.


      What am I doing wrong?

        • 1. Re: Dynamic Task UI via HornetQ
          Maciej Swiderski Master

          output data is dedicated to store the results of the task so until you complete it (or store output explicitly) it won't be set. Usual use case for it is that it will get data from the complete operation that it then can be used to store defined data output process variable.



          • 2. Re: Dynamic Task UI via HornetQ
            bennixview Newbie

            Thanks for your answer it helped a bit...


            but what is the best Approach to get Task Information for building Remote Task UI? Any Example? Do i have to put all Variables in inputData  or in Content with a Map ?


            And the result of


              List<TaskSummary> tasksAssignedAsPotentialOwner = client.getTasksAssignedAsPotentialOwner("admin", "en-UK");


            don't show all actual Tasks. In gwt-consol i see actualy even more tasks ( for "admin" ) than in HornetQClient.


            SOLUTION: The TaskClient needs a unique Name.

            • 3. Re: Dynamic Task UI via HornetQ
              bennixview Newbie

              For Test I use now the "Evalution.bpmn"


              Now I want to retrieve the Content build a generic UI.

              I use the HornetQ TaskService and read the DocumentConten like this:


                   List<Task> tasksAssignedAsPotentialOwner = taskManagement.getAssignedTasks("admin");

                   Task simpleTask = tasksAssignedAsPotentialOwner.get(0);

                   long taskId =  simpleTask.getId();

                   assertEquals(Status.Reserved, simpleTask.getTaskData().getStatus());


                   taskManagement.start(simpleTask.getId(), "admin");

                   simpleTask = taskManagement.getTaskById(taskId);

                   assertEquals(Status.InProgress, simpleTask.getTaskData().getStatus());


                   Content content = taskManagement.getContent(simpleTask.getTaskData().getDocumentContentId());

                   Map<String, Object> contentData = (Map<String, Object>) ContentMarshallerHelper.unmarshall(content.getContent(), null);




              Now i've got all Data from the "Self-Evaluation" Task. But in Content i can only see the Key : reason - Value : Some Reason.


              In the Web View the user have to check some CheckBoxes to give the Task a valid Result. How can I retrieve the Information about the Result Values / Types?

              How to retrieve the Values of performance?

              • 4. Re: Dynamic Task UI via HornetQ
                bennixview Newbie

                I followed that example :




                It works now. Istead of PreProcess Skript Tasks I used the onEntryAction!