[JBoss jBPM] - Sub processe definition is null
by PsmithInOz
There seems to be an issue running processes outside of the container when they contain sub-process. The following code is a simple test that has one process with a contained node that is a sub-process. This code produces the following error:
Exception in thread "main" org.jbpm.JbpmException: can't create a process instance when processDefinition is null
| package com.mincom.ellipse.test;
|
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
|
| public class SubProcessTest {
|
| public static void main(String[] args) {
| ProcessDefinition superDef = ProcessDefinition.parseXmlString("<?xml version=\"1.0\" encoding=\"UTF-8\"?><process-definition xmlns=\"\" name=\"super\"><start-state name=\"start-state1\"><transition to=\"node1\"></transition></start-state><node name=\"node1\"><transition to=\"process-state1\"></transition></node> <process-state name=\"process-state1\"><sub-process name=\"sub\"></sub-process><transition to=\"end-state1\"></transition></process-state><end-state name=\"end-state1\"></end-state></process-definition>");
| ProcessDefinition subDef = ProcessDefinition.parseXmlString("<?xml version=\"1.0\" encoding=\"UTF-8\"?><process-definition xmlns=\"\" name=\"sub\"><start-state name=\"start-state1\"><transition to=\"node1\"></transition></start-state><node name=\"node1\"><transition to=\"end-state1\"></transition></node><end-state name=\"end-state1\"></end-state></process-definition>");
| ProcessInstance superInst = new ProcessInstance(superDef);
| ProcessInstance subInst = new ProcessInstance(subDef);
|
| while(!superInst.hasEnded()) {
| superInst.signal();
| }
| }
| }
|
I've done some reading about this and it seems that the JbpmContext must be initialised and any sub process definitions loaded before the super process is called and signalled. However what do you do if you are unit testing the process or indeed running processes that are not long running or deployed to the database?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219712#4219712
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219712
17 years, 1 month
[JCA/JBoss] - jboss ha datasource configuration to the same host
by brettcave
Would something like this work?
I am using heartbeat + ldirector for HA and loadbalancing of sql servers.
I find that jboss applications become unavailable for a while if the connection gets lost - which happens occassionally due to packet loss. So in trying to get a stable jboss + mysql infrastructure, I would like to use
<ha-tx-local-datasource>
<connection-url>jdbc:mysql://ha.host:3306/db|jdbc:mysql://ha.host:3306/db</connection-url>
The logic being that ldirector monitors mysql, and when a node goes down, it will immediately re-route to the other node. The datasource above uses connection pooling, so in the event of disconnection, it should automatically re-establish to the next server, which is the same server.
Should this work?
Also, i read somewhere that using background-validation with check-valid-connection-sql can cause a conflict, but cant find further info on it... any recommendations for detecting whether connections are valid?
lastly, is using jdbc:mysql://ha.host:3306/db?autoReconnect=true the same as leaving "autoReconnect=true" off the URL and adding it to <connection-property> ?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219700#4219700
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219700
17 years, 1 month