This content has been marked as final.
Show 1 reply
-
1. Re: Is customized task.jsp implemented in current cvs jbpm v
davidsan1001 Dec 1, 2005 1:20 PM (in response to davidsan1001)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"; }