Process Instantiation
goddam Jun 1, 2006 5:43 AMhello..
i am trying to start a process execution by code.. that aparently is well done, because i had it from your examples...
but.. the process don't start..
this code..don't show any errors.. and runs ok..but the aprently it doesn´t do nothing to the process...
can anybody give me a help here?
code:
public class instanciacao{
static JbpmConfiguration jbpmConfiguration = null;
static {
jbpmConfiguration = JbpmConfiguration.parseXmlString(
"<jbpm-configuration>" +
// A jbpm-context mechanism separates the jbpm core
// engine from the services that jbpm uses from
// the environment.
" <jbpm-context>" +
" <service name='persistence' " +
" factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />" +
" </jbpm-context>" +
// Also all the resource files that are used by jbpm are
// referenced from the jbpm.cfg.xml
" <string name='resource.hibernate.cfg.xml' " +
" value='hibernate.cfg.xml' />" +
" <string name='resource.business.calendar' " +
" value='org/jbpm/calendar/jbpm.business.calendar.properties' />" +
" <string name='resource.default.modules' " +
" value='org/jbpm/graph/def/jbpm.default.modules.properties' />" +
" <string name='resource.converter' " +
" value='org/jbpm/db/hibernate/jbpm.converter.properties' />" +
" <string name='resource.action.types' " +
" value='org/jbpm/graph/action/action.types.xml' />" +
" <string name='resource.node.types' " +
" value='org/jbpm/graph/node/node.types.xml' />" +
" <string name='resource.varmapping' " +
" value='org/jbpm/context/exe/jbpm.varmapping.xml' />" +
"</jbpm-configuration>"
);
}
public void inst (int i)
{
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
GraphSession graphSession = jbpmContext.getGraphSession();
ProcessDefinition processDefinition =
graphSession.findLatestProcessDefinition("ultima");
ProcessInstance processInstance =
new ProcessInstance(processDefinition);
} finally {
// Tear down the pojo persistence context.
jbpmContext.close();
}
}
}
this line: " new ProcessInstance(processDefinition);"--> shouldn´t simply start the process choosed?
what is missing?
thanks..[ ]