[jBPM Users] - Re: How to start JobExecutor with jBPM 4 + Spring
by newcomer1
"unsavory" wrote : Does anyone have any idea how to start the JobExecutor? I have configured the JobExecutor in the jbpm.cfg.xml file and it is working. However, it only seems to run when an asynchronous activity is started (ie: a task with a timeout in it is created).
|
| According to the documentation I just need to add this line to my jbpm.cfg.xml:
|
| <job-executor threads="4" idle="15000" idle-max="60000" lock-millis="3600000" />
|
| I'm concerned because the JobExecutor does not seem to run when the server is started such as in a server restart. Therefore if I had old jobs from before the server was shut down, they would not run.
|
| I'm running jBPM 4 in a Spring container if that matters.
We are also running jBPM 4 in spring + JTA and we are not having the same problem as you describe. We start our spring context from a simple war project that uses a parent spring context loader at the ear level (we are also using ejbs). When the application is started the jobexecutor is started automaticly as we have setup spring to execute the buildProcessEngine factory method on SpringJbpmConfiguration at spring startup (lazy-init=false).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259097#4259097
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259097
15 years, 3 months
[JBoss Messaging Users] - Connection pool for ClusteredConnectionFactory, how to ?
by roman.mandeleil@gmail.com
Hi Fellows,
I am trying to gather some information of connection pooling for JMS.
Let's say I have the following architecture:
FrontNode ---> Node1 <---> Node2
FrontNode gets HTTP trafic and forwards it to Node1, Node2 - cluster over JMS protocol.
The system works great but the question is regarding pooling connectionFactory.createConnection():
Basicaly that code runs on FrontNode:
Queue queue = (Queue) initialContext.lookup("/queue/MyQueue");
ConnectionFactory cf = (ConnectionFactory) initialContext
.lookup("/MyClusteredConnectionFactory");
connection = cf.createConnection();
Obviously, the create connection is very heavy opperation because it creates the actual socket for the
message. Two questions:
1) How to configure the pool for the create connection operation ?
2) The connection factory is been accessed as a stub because it been
recieved over JNDI so where the configuration for the pool should be applied on the Node1 or on FronNode ?
*) I am using JBoss 5.1 GA
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259095#4259095
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259095
15 years, 3 months
[jBPM Users] - Re: How can we contribute to development?
by vchira
For the timer Problem a quick fix would be to change the Method setDueDateDescription in class TimerImpl like this:
| public void setDueDateDescription(String dueDateDescription) {
|
| ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
| Object dueDateEvaluated = scriptManager.evaluateExpression(dueDateDescription, null);
| if(dueDateEvaluated instanceof Date)
| {
| dueDate =dueDateEvaluated;
| return;
| }
| dueDateDescription = (String) dueDateEvaluated;
|
| Duration duration = new Duration(dueDateDescription);
| Date now = Clock.getCurrentTime();
|
| ...........................................
| }
|
a better solution would be to add a dueDateTimeDefinition in TimerDefinitionImpl and in JobParser.parseTimerDefinition() just set the definition there. after that in ScopeInstanceImpl.createTimer() evaluate dueDateTimeDefinition and if the evaluation returns a Date just set it in dueDate otherwise pare dueDateTimeDefinition as a date String..like you do now in JobParser.parseTimerDefinition().
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259093#4259093
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259093
15 years, 3 months
[jBPM Users] - Re: How to start JobExecutor with jBPM 4 + Spring
by vchira
I have done something like this:
| import org.jbpm.api.ProcessEngine;
| import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
| import org.springframework.beans.factory.annotation.Required;
| import org.springframework.context.ApplicationEvent;
| import org.springframework.context.ApplicationListener;
| import org.springframework.context.event.ContextClosedEvent;
| import org.springframework.context.event.ContextRefreshedEvent;
|
|
| public class JbpmJobExecutorLoader implements ApplicationListener {
|
| private ProcessEngine processEngine;
|
| @Required
| public void setProcessEngine(ProcessEngine processEngine) {
| this.processEngine = processEngine;
| }
|
| public void onApplicationEvent(ApplicationEvent applicationEvent) {
| if (applicationEvent instanceof ContextRefreshedEvent) {
| JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
| if (!jobExecutor.isActive()) {
| jobExecutor.start();
| }
| } else if (applicationEvent instanceof ContextClosedEvent) {
| JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
| jobExecutor.stop();
| }
| }
|
processEngine will be wired by Spring.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259082#4259082
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259082
15 years, 3 months