1 Reply Latest reply on Dec 1, 2005 1:20 PM by David Sanchez

    Is customized task.jsp implemented in current cvs jbpm versi

    David Sanchez Novice

      Is it there? I only want to upgrade once to a reasonable stable version since I inevitabley have configuration problems when getting the latest cvs (my fault, not your guys)

      If so (or even if its not) how will it be implemented? Are you modifying the HomeBean? Will we have to create a process variable with the target then update the faces-config.xml?

      Dave

        • 1. Re: Is customized task.jsp implemented in current cvs jbpm v
          David Sanchez Novice

          Guess not. Here is a hack I came up with that does the job.

          Add this event script to create a context variable that will hold the name of jsf target. You can put this in the same places you can put an Action Handler.

          <event type="node-leave">
           <script>
           <expression>
           executionContext.setVariable("taskjspface", "task1")
           </expression>
           </script>
           </event>
          

          Then in the HomeBean, I changed the method "selectTaskInstance" to the below code. This hack does require that you set the context variable then set it back to null for every task you want to have a customized jsp for. Also don't forget to update the faces-config.xml with your new navigation rule (target) and add the jsp.
          public String selectTaskInstance() {
           // Get the task instance id from request parameter
           long taskInstanceId = JsfHelper.getId("taskInstanceId");
           TaskInstance taskInstance = taskMgmtSession.loadTaskInstance(taskInstanceId);
           taskBean.initialize(taskInstance);
          
           Token currentToken = taskInstance.getToken();
          
           ProcessInstance processInstance = currentToken.getProcessInstance();
          
           ContextInstance contextInstance = processInstance.getContextInstance();
          
           String taskjspface1 = (String)contextInstance.getVariable("taskjspface");
          
           if (taskjspface1 != null)
           return taskjspface1;
           else
           return "task";
           }