[JBoss jBPM] - Automate Workflow Steps
by ashishc
Hi All,
I have create a simple workflow which has 2 nodes, a start state and an end state. Here is the source...
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="http-demo-process">
| <swimlane name="initiator">
| <assignment actor-id="manager" />
| </swimlane>
|
| <start-state name="start">
| <transition to="call action"></transition>
| </start-state>
|
| <node name="call action">
| <action class="com.sample.action.MessageActionHandler">
| <message>First Message</message>
| </action>
| <transition to="post data"></transition>
| </node>
| <node name="post data">
| <action class="com.sample.action.PostActionHandler">
| <message>First Message</message>
| </action>
| <transition to="end"></transition>
| </node>
| <end-state name="end"></end-state>
| </process-definition>
Now after I deploy, in the jbpm-console, I have to click to start the workflow and then at every step I have to click start-end to finally reach the end of the workflow.
Is there someway I can automate the entire process??
Here is the action class for the node above:
package com.sample.action;
|
| import org.jbpm.graph.def.ActionHandler;
| import org.jbpm.graph.exe.ExecutionContext;
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
|
| public class MessageActionHandler implements ActionHandler {
|
| Log log = LogFactory.getLog(this.getClass());
| private static final long serialVersionUID = 1L;
|
| /**
| * The message member gets its value from the configuration in the
| * process definition. The value is injected directly by the engine.
| */
| String message;
|
| /**
| * A message process variable is assigned the value of the message
| * member. The process variable is created if it doesn't exist yet.
| */
| public void execute(ExecutionContext context) throws Exception {
| context.getContextInstance().setVariable("message", message);
| log.info("Printing Message at end: " + message);
| //context.leaveNode();
| String taskName = context.getTaskInstance().getName();
| log.info("taask name " + taskName);
|
| }
|
| }
What I want to do is start the workflow and then it goes through all the steps and reaches end.
Also whats the best way to pass data (or values) from one step to another in the jbpm Workflow.
Please advise.
Thanks
Ashish
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162932#4162932
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162932
17 years, 9 months
[JBoss jBPM] - Using multiple tokens
by twiceknightly
Hi,
I am using jbpm to produce a bit of software that allows 3 different people to work on a process instance concurrently. Each of these roles have different things they can do to the process instance and they can work concurrently on a single process instance.
My process graph has 3 different branches corresponding to the roles. A new token is created for each of the role types. At the start the tokens traverse to the appropriate bit of the process graph for them.
Most of the time these three parts of the process graph don't interact. So a user in a role just merrily closes task related to him/makes traversals to other nodes that concern him. Basically all three tokens (threads) run until the process instance is destroyed. There is no joining of the tokens.
My problem is that occasionally there must be some communication between the 3 threads. For example the first token wants to signal the second token into a certain state on completion of some work. On another occassion they want to share info in the contextinstance.
The concurrency issues really worry me. For example if someone is working token two via a UI driven client however at the same time token one wants to move thread two into a different state. This could result in a race condition. Thread one updates could be lost.
Any thoughts on how I could have multiple threads running over a process graph. Then periodically I want to be able to synchronize them (perhaps put them into a node with no transitions)? Then I want to perform some action. Then I want to return the tokens to the nodes they were at and return them to running as if nothing had happened.
Could anyone outline how the join node works and how it's synchronization is accomplished? Perhaps that will provide a clue.
thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162894#4162894
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162894
17 years, 9 months
[JBoss jBPM] - Message driven bean and jbpm
by anb@beyondfibre.tv
Hello,
I have a seam project where a process is started by seam through a @CreateProcess. Then one node schedule an action using Quartz. The scheduled action then sends a JMS which an MDB uses to signal the process to continue the execution.
However my problem is that once the MDB signal the process, one node will make access to the database. I get problems with transactions and it's a nightmare. I tried many things from annotating the MDB for CMT or BMT with no success. I tried injecting the hibernate session into the jbmpcontext but couldn't get my hands on the sessionfactory. Before I submit a stack trace, I would just like to know what exactly is the right way to go ?? How does one handle this transaction mess. It is really hard to find documentation on the subject or maybe I don't know where to look.
Any help will be gladly appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162762#4162762
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162762
17 years, 9 months