[JBoss jBPM] - Re: jBPM 4 ProcessFactory/ProcessBuilder not found
by sterjev.marjan
package impl;
import org.jbpm.api.activity.ActivityBehaviour;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.jpdl.internal.activity.StartActivity;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
/**
* @author Marjan Sterjev
*
*/
public class Display implements ActivityBehaviour {
private static final long serialVersionUID = 1L;
String message;
public Display(String message) {
this.message = message;
}
public void execute(ActivityExecution execution) {
System.out.println(message);
}
public static void main(String[] args) throws Throwable {
ProcessDefinitionBuilder builder = ProcessDefinitionBuilder
.startProcess("Hello World");
builder.startActivity(new StartActivity()).initial().transition(
"hello display").endActivity();
builder.startActivity("hello display", new Display("Hello"))
.transition("world display").endActivity();
builder.startActivity("world display", new Display("World"))
.endActivity();
ProcessDefinitionImpl processDefinition = builder.endProcess();
processDefinition.startProcessInstance();
}
}
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240933#4240933
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240933
14 years, 9 months
[JBoss Messaging] - Re: Clustering differences versus JBoss MQ
by kennardconsulting
gaohoward,
Awesome. You are a legend. Look forward to hearing how you go. If it helps:
1. I made the changes described in the Wiki, then copied the 'all' folder to a new folder (I called it 'cluster2') and started a second instance of JBoss using 'run -c cluster2 -Djboss.service.binding.set=ports-01'. You will see the second instance fails to start because 'DefaultJMSProvider not bound'
2. DefaultJMSProvider is defined in jms-ds.xml. The Wiki instructs you to move this into deploy-hasingleton, which I believe is a mistake. In JBoss 4.2.3 the jms-ds.xml stays in the deploy folder (in the 'all' config)
3. You can try moving jms-ds.xml back to deploy, and things go better. However the MDBs no longer seem to 'wake up' upon bouncing a cluster node
Regards,
Richard.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240930#4240930
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240930
14 years, 9 months
[JBoss Cache: Core Edition] - Re: BerkeleyDB Deadlock Exception from JBoss Cache Loader: B
by galder.zamarreno@jboss.com
"niuxuetao_fiserv" wrote : About the write-intensive stuff, yes, we will have a lot more calls to attach() than modifying the already cached Pojos.
Attaching a pojo is an expensive operation where the pojo is dissected and mapped to the cache, hence such operation should be used as less as possible. Detailed information on the process can be found in http://www.jboss.org/file-access/default/members/jbosscache/freezone/docs...
If you're calling attach more often than modifying the Pojo directly, I'm not sure of the suitability of PojoCache in your case. It might even be more of a burden than using plain JBoss Cache. The point of a PojoCache is that you attach once and then you interact with the bean as normal, calling it's getters,setters...etc and when you're done with it, you detach it.
"niuxuetao_fiserv" wrote : 1. If I call attach() with a key and value that already exist in the cache, what will happen?
Hmmm, do you mean what happens when you attach a pojo under a fqn+key that already contains a pojo? In that case, the existing pojo is detached and the new one is reattached. Due to the reasons above, this is an expensive operation.
"niuxuetao_fiserv" wrote : 2. How do I use transaction in java code to explicitly begin and end a transaction?
| - DummyTransactionManager.getUserTransaction()?
| - or like describe in this page? http://www.jboss.org/file-access/default/members/jbosscache/freezone/docs... which looks a pretty old doc?
|
Well, depends the environment in which you're in. If you're within an application server, you get a UserTransaction from JNDI or from an EJB context.
If you're outside of an application server, you should be using something like JBoss Transactions that allows setting up a transaction manager and getting a user transaction. You can find examples in their docu.
Finally, DummyTransactionManager does what it says on the tin. It's dummy, so it's not really a transaction manager, it's simply used as a mock for testing purpouses and hence you shouldn't be using it in conjunction with your production code.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240929#4240929
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240929
14 years, 9 months