This content has been marked as final.
Show 3 replies
-
1. Re: Not getting latest Process definition
kukeltje Nov 30, 2005 2:35 PM (in response to chprvkmr)how do you deploy thisw new par file?
-
2. Re: Not getting latest Process definition
chprvkmr Nov 30, 2005 11:49 PM (in response to chprvkmr)Hi Kukeltje,
My par file contains below contents::
gpd.xml
processdefinition.xml
processimage.xml
I have created a new process project using eclipse plugin, which created by default sample.par folder with above contents. Later I modified the processdefinition.xml file, adjusted the image [ as boxes are overlapped], checked whether processimage.jsp reflects my processdefinition or not. If everyting is fine then compressed sample.par folder and renamed it to testPdef1.par.
Iam loading this par file through a jsp page<%@ page language="java" %> <%@ page import="org.jbpm.graph.def.*,org.jbpm.graph.exe.*,org.jbpm.taskmgmt.exe.*,com.sample.workflow.bean.*,java.util.*,org.jbpm.db.*,com.sample.workflow.context.*,java.io.*" %> <% UserBean objUserBean = (UserBean) session.getAttribute("userBean"); if(objUserBean == null) { %> <jsp:forward page="demo1Login.jsp"/> <% } String processDefPARPath = request.getParameter("xmlPathProcessDef"); if(processDefPARPath == null || processDefPARPath.trim().equals("")) { %> <center>Please select process definition path to continue ..... <p><a href="demo1Home.jsp">Home</a></center> <% return; } %> <% // Get process definition ProcessDefinition processDefinition = null; try { processDefinition = ProcessDefinition.parseParResource(processDefPARPath); } catch(Exception fne) { %> <p><font color='red'>Error:: <%= fne.getMessage() %></font> <p><center>Failed to start process. <p><a href="demo1Home.jsp">Home</a></center> <% fne.printStackTrace(); return; } // Save process definition in db. JbpmSession jbpmSession = Context.getPersistenceContext().getJbpmSession(); GraphSession graphSession = jbpmSession.getGraphSession(); graphSession.saveProcessDefinition(processDefinition); %> <center>Started process with Id, <b><%= processDefinition.getId() %></b> successfully <p><a href="demo1Home.jsp">Home</a></center>
This way Iam able to store par file in database. Later I can get the processdefinitions with graphSession.getLatestProcessDefinitions() method.
If I try to deploy another/modified processdefinition with the same name as that of already existing process definition[old one], its getting loaded successfuly. But while fetching process definition list[graphSession.getLatestProcessDefinitions()], instead of modified process definition, old process definition is fetched.
-
3. Re: Not getting latest Process definition
chprvkmr Dec 1, 2005 8:25 AM (in response to chprvkmr)Anyone can listout the situations where graphSession.findLatestProcessDefinitions() fails to fetch latest definitions. For a particular processdefinition Iam getting old version being listed instead of latest one.