-
1. Re: jBPM HowTo add User Group Swimlane to DB?
newbie007 Jul 31, 2006 9:50 AM (in response to kvak_tnt)You can add the user etc eigher by using the SQL or by using the hibernate session (You should be able to get the session from the jbpm context or configuration).
Use <hibernate session>.save(user) if you are using hibernate session. make sure you populate the user object before saving. Also please make sure you follow the correct order for inserting (if there is any foreign key reference, you will have to insert the record in the other table first).
Thanks. -
2. Re: jBPM HowTo add User Group Swimlane to DB?
kvak_tnt Jul 31, 2006 10:03 AM (in response to kvak_tnt)Thanks for the quick reply. I will try to.
I have found another info about this "problem"
identity.hbm.xml
Does anyone know something about the use of this file?
I haven't found anything in the web but I have found another post with this file:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=76736
Greetings
Claus -
3. Re: jBPM HowTo add User Group Swimlane to DB?
kvak_tnt Jul 31, 2006 11:03 AM (in response to kvak_tnt)OK I solved it myself.
Example:
identity.xml<identity> <user name="bert" email="bert@sesamestreet.tv" password="theresabananainyourear" /> <user name="ernie" email="ernie@sesamestreet.tv" password="canthereyoubert,theresabananainmyear" /> <group name="sesameinhabitants" /> <group name="bananalovers" parent="sesameinhabitants" type="fruitpreference" /> <membership user="ernie" group="bananalovers" /> </identity>
Your handling class for users and so on:public void setUp(){ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext(); Entity[] entities = IdentityXmlParser.parseEntitiesResource("identity.xml"); for (int i=0; i < entities.length; i++) { jbpmContext.getSession().save(entities); }
Thats all.
Greetings Claus