[JBoss jBPM] - How to save process instance into database?
by slacker27
the next is my code :
private void execute() throws Exception {
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
GraphSession graphSession = jbpmContext.getGraphSession();
TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
long processDefinitionId = 1;
org.jbpm.graph.def.ProcessDefinition processDefinition = graphSession.loadProcessDefinition(processDefinitionId);
ProcessInstance processInstance = new ProcessInstance(processDefinition);
org.jbpm.taskmgmt.exe.TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
processInstance.signal();
jbpmContext.save(processInstance);
System.out.println(jbpmContext.getSession().isOpen());
Token token = processInstance.getRootToken();
System.out.println("LAST NODE:" + token.getNode().getName());
}
after i execute it, i found the process instance data has not been saved in db(mysql),
And I know if i call "jbpmContext.close()" explicitly, it was saved.
Has there any other ways to do that?
(for example: by modifing the configuration file and do not midifing the code)
And when i config my :jbpm.cfg.xml" followed the direction in chapter 7 in the user's guide like this:
exception thrown:
Exception in thread "main" org.jbpm.JbpmException: couldn't parse jbpm configuration from resource 'jbpm.cfg.xml'
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:284)
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:256)
at Test.execute(Test.java:30)
at Test.main(Test.java:23)
Why?
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982613#3982613
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982613
19Â years, 6Â months
[JBossCache] - Re: Deadlock PojoCache.putObject()/org.apache.log4j.Category
by dkapustin
It's JBossCache 1.4.0SP1.
Your restatement is correct, Brian, more specifically:
1. We put aspectized Participant object in the cache
2. We add Message object to the Participant.newMessages List
3. Message object has reference sender to Participant object and reference recipient to Recipient object which class is an abstract super class of Participant object class.
4. Recipient class declared with @InstanceOfPojoCacheable
5. So, both, sender and recipient are aspectized but are not in the cache
6. recipient in this case is a Conference object which has List of its Participants
7. In turn, Participant has a List of Conferences it participates in.
8. Actually, all these POJOs are [derived from] ValueObjects with a HashMap of attributes.
We debugged the deadlock again and found out that during serialization of the first sender's Conference attributes the framework (RegularObjectPersister.writeSlotWithFields()) tries to serialize MarshalledClassProxy which substitutes? attributes.
And here the whole story begins.... MarshalledClassProxy.advisor gets serialized and this leads to whole cache serialization.
Hope this explanation helps :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982609#3982609
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982609
19Â years, 6Â months
[JBoss Seam] - EL enhancement with Enums
by lcoetzee
Hi,
we would like to use the EL enhancement which would allow us to send a Enum param back. allLanguagesManager is an arraylist containing all the enums:
<t:dataList value="#{allLanguagesManager}" var="currentLanguage"
| rendered="#{not empty allLanguagesManager}" id="dt1">
| <h:column id="col">
| <li>
| <s:link action="#{userEnvironment.setLanguage(currentLanguage)}" >
| <h:outputText id="lang" value="#{currentLanguage}"
| converter="languageconverter" />
| </s:link>
| </li>
|
| </h:column>
| </t:dataList>
userEnvironment is a POJO with a public method:
| public void setLanguage(LanguageEnum language) {
|
| if (null == language) logger.info("oops language is null");
| logger.info("language class is of type" + language.getClass().toString());
| logger.info("setting the language in userEnvironment");
|
| .
| .
|
For some reason the language param is null when the method gets invoked by Seam. If I change things around to send a literal string (and changing the pojo method) the literal is passed on to the method.
Any suggestions ?
Thanks
L
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982603#3982603
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982603
19Â years, 6Â months