TaskInstance duedate not being persisted ??
marcus.junk Sep 12, 2005 12:08 AMHey All,
I have a simple piece of test code that creates a very simple business process with a task that has a duedate attribute.
I create and start an instance of this ProcessInstance and then save the processInstance.
The problem is that ....... now when I inspect the database table JBPM_TASKINSTANCE the duedate column has not been populated.
I have tried debugging this by watching the duedate member on the TaskInstance class and it never gets initialised when the Task gets created.
Can one of the JBPM "experts" please verify this is a bug or better still tell me what I'm doing wrong and thus how to resolve this issue.
Thanks in advance, Marcus.
PS. this is the simple code that I am running, I am using a MS SQL Server database.
static JbpmSessionFactory jbpmSessionFactory = JbpmSessionFactory.buildJbpmSessionFactory(); public void timerDueNotPersisted(){ String processDefinitionXml = "<process-definition " + " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' " + " name='SimpleTaskProcess'> " + " <start-state name='start'> " + " <transition name='toTask' to='task'></transition> " + " </start-state> " + " <end-state name='end'></end-state> " + " <task-node name='task'> " + " <task name='SimpleTaskDue' duedate='120 seconds'></task> " + " <transition name='toEnd' to='end'></transition> " + " </task-node> " + "</process-definition>"; ProcessDefinition deployProcessDefinition = ProcessDefinition.parseXmlString(processDefinitionXml); ProcessArchiveDeployer.deployProcessDefinition(deployProcessDefinition, jbpmSessionFactory); JbpmSession jbpmSession = null; try { jbpmSession = jbpmSessionFactory.openJbpmSession(); jbpmSession.beginTransaction(); ProcessDefinition processDefinition = jbpmSession.getGraphSession().findLatestProcessDefinition("SimpleTaskProcess"); ProcessInstance processInstance = new ProcessInstance(processDefinition); // start bp instance processInstance.signal(); // save bp jbpmSession.getGraphSession().saveProcessInstance(processInstance); jbpmSession.getSession().flush(); jbpmSession.commitTransaction(); // now in the database table JBPM_TASKINSTANCE the 'duedate' is null. } finally { if (jbpmSession != null){ jbpmSession.close(); } } }