9 Replies Latest reply on Nov 17, 2008 9:22 AM by webernie

    description-tag

    webernie

      Hi,

      in the processdefinition.xml I want to parse the description-tag. Somewhere in this forum I read that this is not possible. Can anyone confirm this?

      Is there a way to read the content of this tag, at all?

      I tried to get the content as follows:

      task.getEncapsulatedTaskInstance().getDescription()
      // task is a JbpmTaskInstance

      The problem here is:
      task.getEncapsulatedTaskInstance() is NULL!!


      I'm thankfull for any proposal.

        • 1. Re: description-tag
          salaboy21

          You want to obtain a task Description??

          why don't you use TaskMgmtSession http://docs.jboss.org/jbpm/v3/javadoc/org/jbpm/db/TaskMgmtSession.html

          and then with your TaskInstances the getDescription() method?
          http://docs.jboss.org/jbpm/v3/javadoc/org/jbpm/taskmgmt/exe/TaskInstance.html

          I think that I'm missing something here...
          HOpe it helps

          • 2. Re: description-tag
            webernie

            Thanks for your quick answer!

            In the projekt I'm working on, there is no TaskMgmtSession. So I create a new one:

            TaskMgmtSession tms = new TaskMgmtSession(...);
            tms.getTaskInstance(task.getId()).getDescription()

            and for this I need a JbpmSession. But JbpmSessions are deprecated!

            So how can I use TaskMgmtSession?

            • 3. Re: description-tag
              salaboy21

              I think you need to obtain the TaskMgmtSession from de JbpmContext..

              • 4. Re: description-tag
                webernie

                With TaskMgmtSession I can obtain the Task-ID and the Task-Name but the Description is always NULL :-(

                I tried these lines, but it doesn't work.

                JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
                JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
                TaskMgmtSession tms = new TaskMgmtSession(jbpmContext.getSession());
                tms.getTaskInstance(task.getId()).getDescription();
                tms.getTaskInstance(task.getId()).getTask().getDescription() );

                Does anyone have other/more proposals how to obtain the content of the description-tag of a task??

                • 5. Re: description-tag
                  salaboy21

                  Yes, now I realize the problem... is not an API problem..
                  Is that you are setting the description of the task-node and not the description of the taskInstance.
                  Check out in your code.. and look where did you put the description...
                  Hope it helps...

                  • 6. Re: description-tag
                    webernie

                    1. What du you mean with where I put the description?
                    The description is in the processdefinition.xml, for example so:

                    <task-node name="...">
                    ...
                    ...
                    </task-node>

                    2. I thought this line says that I'm getting the the description of the taskInstance:
                    tms.getTaskInstance(task.getId()).getDescription();

                    If not, what would you change?

                    • 7. Re: description-tag
                      webernie

                      The example was not sumitted right. It should look like this:

                      <task-node name="...">
                       <description> ... </description>
                       <task name="...">...</task>
                      </task-node>
                      


                      • 8. Re: description-tag
                        salaboy21

                        To retrive the description of a task-node or a taskInstance you first need to set it.
                        So you can set it via API with the setDescription method or you can set it in the processdefinition.xml:

                         <task-node name="task-node1">
                         <description>
                         Task-NODE description!!!!!!!!!!
                        
                         </description>
                         <task name="taskInstanceName">
                         <description>
                         Task INSTANCE DESCRIPTION!!!!!!!!!!
                        
                         </description>
                         </task>
                         </task-node>
                        

                        Look for the tags called description and notice the diference!

                        • 9. Re: description-tag
                          webernie

                          Ok, one week later I found the time to work on still the same problem.

                          So now I know, that when I set the description I can retrieve it again. But my task is to retrieve a description that is already written in the processdefinition.xml. That means I don't wanna set any description, because it is already in the xml file.

                          Can it be, that when the file is parsed the description is not retrieved?
                          This would mean that TaskMgmtSession doesn't help me. Is there a way to retrieve the description anyway???