[jBPM Users] - Re: does JBPM support below features?
by salaboy21
@Jan
The Drools team always appreciates feedback, so I would like to ask you to clarify a few of your statements if that is ok?
What gives you the impression that Drools Flow does not perform well in the Java world? An action node can contain any Java code you want. You have direct access to your process variables (as if they were local variables) and you have clear access to your context through a kcontext object. You can easily define processes in Java (if you don't like XML) using a fluent API. The engine itself is a simple Java POJO component that can run embedded (without any db even). What features are we missing to make it even more Java-friendly?
Let's suggest you have an application where you're not that interested in rules. Why do you think Drools Flow has a more complex architecture in that case (basically both engines are implemented as a simple state machine, if you don't use rules the underlying technology is very similar)? Does the fact that it is also possible to use rules make the overall solution more complex? We tried to keep the APIs separate as much as possible though (check out http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/..., I don't think it can get much easier than that?).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254504#4254504
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254504
16 years, 7 months
[jBPM Users] - Timer is not working
by prajatna
Hi,
I have designed a timer with a task node. simply it should print a message after the given duedate i.e 20 seconds. the code is as follows..
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="newTravelProcess">
|
| <start-state name="start">
| <transition to="PM: Approval" name="for PM approval"></transition>
| </start-state>
|
| <task-node name="PM: Approval">
| <task name="waitForPMApproval">
| <description>
| Waiting for the PM to approve the request
| </description>
| <assignment class="com.sample.action.NodeAssignAction"></assignment>
| </task>
| <timer duedate="20 seconds">
| <action class="com.sample.action.TimerAction" name="ReminderAction"></action>
| </timer>
| <transition to="approveRequest" name="approvedByPM"></transition>
| <transition to="Booking Rejected" name="PM_rejected"></transition>
| </task-node>
So, here as per the document it should create the Timer on entry of this task node, and should execute the timer action after 20 seconds..
My problem is that the timer is creating , but after 20 sec , nothing is happening...
Below is the code for TimerAction
| public class TimerAction implements ActionHandler {
|
| private static Log log = LogFactory.getLog(TimerAction.class);
| public void execute(ExecutionContext executionContext) throws Exception {
|
| log.debug("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
| log.debug("Please approve the request ASAP");
| log.debug(executionContext.getNode().getName());
| }
|
| }
and here how i am calling my process from inside a java class
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
|
| //-------------- Extract a process definition from the processdefinition.xml file.----------
| ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("simple/processdefinition.xml");
| jbpmContext.deployProcessDefinition(processDefinition);
|
|
| //--------------- Extracting process from DB with process name -----------------
|
| String processName = "newTravelProcess";
| GraphSession graphSession = jbpmContext.getGraphSession();
| processDefinition = graphSession.findLatestProcessDefinition(processName);
| ProcessInstance processInstance = new ProcessInstance(processDefinition);
|
| //--------------- Create and start the Process execution with Token -----------------
| Token token = processInstance.getRootToken();
|
| log.debug("...Node is....." + token.getNode().getName());
| token.signal();
|
Can you please suggest , why the timer is not executing after 20 sec...
I am using JBPM 3.2.2
also find below the logs
| 17:16:42,412 [main] DEBUG TravelTester : ...Node is.....start
| 17:16:42,412 [main] DEBUG GraphElement : event 'before-signal' on 'StartState(start)' for 'Token(/)'
| 17:16:42,412 [main] DEBUG GraphElement : event 'node-leave' on 'StartState(start)' for 'Token(/)'
| 17:16:42,412 [main] DEBUG GraphElement : event 'transition' on 'Transition(for PM approval)' for 'Token(/)'
| 17:16:42,412 [main] DEBUG GraphElement : event 'node-enter' on 'TaskNode(PM: Approval)' for 'Token(/)'
| 17:16:42,412 [main] DEBUG GraphElement : executing action 'CreateTimerAction(15c97e4)'
| 17:16:42,412 [main] DEBUG Token : token[3110] is locked by token[3110]
| 17:16:42,422 [main] DEBUG GraphElement : event 'timer-create' on 'TaskNode(PM: Approval)' for 'Token(/)'
| 17:16:42,432 [main] DEBUG Token : token[3110] is unlocked by token[3110]
| 17:16:42,442 [main] DEBUG GraphElement : event 'task-create' on 'Task(waitForPMApproval)' for 'Token(/)'
| 17:16:42,442 [main] DEBUG NodeAssignAction : This Node is-------PM: Approval
| 17:16:42,442 [main] DEBUG NodeAssignAction : Current TaskId-----3453
| 17:16:42,442 [main] DEBUG GraphElement : event 'after-signal' on 'StartState(start)' for 'Token(/)'
| 17:16:42,442 [main] DEBUG TravelTester : ...Node after signal is .....PM: Approval
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254418#4254418
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254418
16 years, 7 months