Hi,
We've developed an engine for executing process instances. Until know, we only
need execution of stateless processes, so we get the root token, and signal on
it until reaching the final state. Everything works fine till here. We have a
WS facade for starting the Process executions.
The problem is that execution times increase linearly as the number of clients
increase, which isn't the desired behaviour.
Everything seems to scale up properly, but for the JBPM engine. Theres is
plenty of cpu time left, plenty of threads configured in the AS, plenty of
everything, but isn't scaling.
I post you here the execution logic we use so any of you can help us finding a
solution.
Thanks
| JbpmContext ctx = null;
| boolean newContext = false;
| try {
| // Fetch JbpmContext
| ctx = getJbpmConfiguration().getCurrentJbpmContext();
| if (ctx == null) {
| ctx =
getJbpmConfiguration().createJbpmContext();
| newContext = true;
| }
|
| // Get process definition
| ProcessDefinition processDefiniton = null;
| if (version == null) {
| processDefiniton = ctx.getGraphSession()
|
.findLatestProcessDefinition(processName);
| } else {
| processDefiniton =
ctx.getGraphSession().findProcessDefinition(
| processName, version);
|
| }
| if (processDefiniton == null) {
| throw new
ProcessDefinitionNotFoundException(processName,
| version);
| }
|
| // Create instace, add input params as context variables
|
| ProcessInstance instance = new
ProcessInstance(processDefiniton);
| instance.getContextInstance().setTransientVariable(
| "REQUEST", req);
|
| // Execute process
| do{
| instance.getRootToken().signal();
| } while
(!EndState.class.isAssignableFrom(instance.getRootToken().getNode().getClass()));
|
| // Get output parameters
| Map<String, Serializable> response = (Map<String,
Serializable>) instance.getContextInstance().getTransientVariable("RESPONSE");
| return response;
| } catch (Exception e) {
| throw new JbpmEngineException("Unexpected error", e);
| } finally {
| if (ctx != null && newContext) {
| ctx.close();
| }
| }
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023855#4023855
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023855
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user