-
1. Re: Persistance and setActorId
kukeltje Mar 11, 2009 9:59 PM (in response to frinux)your hibernate config is wrong I guess
-
2. Re: Persistance and setActorId
frinux Mar 12, 2009 4:53 AM (in response to frinux)Here is my hibernate config file :
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.url">jdbc:mysql://localhost:3306/econges</property> <property name="connection.username">root</property> <property name="connection.password">unilog</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> </session-factory> </hibernate-configuration>
It's a quite simple one... -
3. Re: Persistance and setActorId
frinux Mar 12, 2009 5:05 AM (in response to frinux)In a forum I saw that 3 elements are required for hibernate:
- a javabean
- a mapping file
- a configuration file
I wrote the last one only, because in jBPM documentation there is no trace of the others. I also saw that jBPM handle everything for the persistance, so that we just have to execute the contextInstance.setVariable().
Am I right? What did I forget? -
4. Re: Persistance and setActorId
kukeltje Mar 12, 2009 10:16 AM (in response to frinux)The full hibernate configuration indeed consists of multiple files (or at least multiple sections) the mapping file is in the jbpm jar. If the config file you posted is in the wrong place it cannot find the mapping files.
-
5. Re: Persistance and setActorId
frinux Mar 12, 2009 10:23 AM (in response to frinux)Hum the file is in the right place, I mean it is taken because it connects to the database.
I added the mapping files of my classes.
But I think the problem is somewhere else. When I'm debugging my action, I see that everything is going wrong since I step into the signal() function :boolean response = false; //required fields, otherwise an exception is thrown... if(demande == null || demande.getDemandeur().getUsername().equals("")) { return false; } // Lookup the pojo persistence context-builder that is configured above JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext(); try { ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("demande/processdefinition.xml"); //process definition deployment //jbpmContext.getGraphSession().deployProcessDefinition(processDefinition); ProcessInstance processInstance = new ProcessInstance(processDefinition); //creates the instance variables processInstance.getContextInstance().setVariable("demande", demande); processInstance.getContextInstance().setVariable("dateEmissionDemande", new Date()); // let's go ! processInstance.setStart(new Date()); processInstance.signal(); //we check if the current active node is the right one : validation Token currentToken = processInstance.getRootToken(); if(currentToken.getName().equals("validation")) { response=true; } else { response=false; } jbpmContext.save(processInstance); } finally { jbpmContext.close(); } return response;
It doesn't go further than processInstance.signal();
It comes directly to the finally. -
6. Re: Persistance and setActorId
frinux Mar 12, 2009 10:31 AM (in response to frinux)Sorry my last message doesn't help. I catched the exception and I came back to the first one :
couldn't assign id to TaskInstance(validate)
The problem is still there...