0 Replies Latest reply on Apr 17, 2012 12:38 PM by Jboss fan99

    TaskSummary.getName() returns null while using persistence

    Jboss fan99 Newbie


        I'm using persistence for using jBPM 5.2 with Jboss 7. Server startups properly and jBPM also loads up properly. I'm able to start the processes using jBPM APIs. In my BPMN file, I have usertasks defined and once process is started, process stops at userTask for taking in feedback of the user, which is the expected flow.

      But now I want to show to user various human tasks that he's the owner of and also wants to display the name of the task that's currently assigned to him. So I'm getting TaskSummary by using below code:


      BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();

                          taskClient.getTasksAssignedAsPotentialOwner(userId, "en-uk", responseHandler);

                          List<TaskSummary> taskSummaries = responseHandler.getResults();


      It successfully returns the TaskSummary List but when I do getName or getDescription on TaskSummary instance, it returns null.

      Then I looked at named queries defined in Task-orm.xml. Seems like it's getting name and description from I18NText table, which is empty in my database. That looks like a problem.


      Can someone please help with this? How can I make TaskSummary.getName() return right values.


      I''m using below code to instantiate StatefulKnowledgeSession:


      KnowledgeBase kbase = readKnowledgeBase(); // read knowledgebase from a private method


                          Environment env = KnowledgeBaseFactory.newEnvironment();

                          env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

                          env.set( EnvironmentName.TRANSACTION_MANAGER,

                                                                  /* setting my transaction manager*/ );

                          env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());


                          Integer ksessionId = retrieveKnowledgeSessionId(); //retrieves knowledge session id from DB

                          if (ksessionId == null)


        // create a new knowledge session that uses JPA to store the runtime state

        ksession =

                                                  JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );




        ksession =

                                                        JPAKnowledgeService.loadStatefulKnowledgeSession(ksessionId, kbase, null, env);



                          jbpmLogger = new JPAWorkingMemoryDbLogger(ksession);


                          CommandBasedWSHumanTaskHandler humanTaskHandler =

                                              new CommandBasedWSHumanTaskHandler(ksession);

                          ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);