<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR><LINK 
href="BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}" 
rel=stylesheet></HEAD>
<BODY style="FONT-SIZE: 10pt; MARGIN: 10px; FONT-FAMILY: verdana">
<DIV><FONT face=Verdana size=2>Hi All:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp; I have a big problem when suspending/resuming a 
ProcessInstance in jBPM4.</DIV>
<DIV>&nbsp;&nbsp;&nbsp;A few days ago, I saw there are some feature for 
Suspending/Resume Execution in jBPM4. So I add this feature to the todolist of 
my project. But when I start work on this part, I find there is no method in api 
package to support these feature.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp; First I think suspend/resume is similar with the end/delete 
operation in the ExecutionService.java, but there is no such method. So I go to 
the Execution.java, Fortunately, there are some code for the suspend:</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV><STRONG>&nbsp;&nbsp;/**&nbsp;indicates&nbsp;that&nbsp;this&nbsp;execution&nbsp;is&nbsp;temporary&nbsp;suspended&nbsp;with&nbsp;the</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;*&nbsp;{@link&nbsp;#suspend()}&nbsp;method.&nbsp;&nbsp;Human&nbsp;tasks&nbsp;of&nbsp;a&nbsp;suspended&nbsp;execution</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;*&nbsp;shouldn't&nbsp;show&nbsp;up&nbsp;in&nbsp;people's&nbsp;task&nbsp;list&nbsp;and&nbsp;timers&nbsp;of&nbsp;suspended</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;*&nbsp;executions&nbsp;shouldn't&nbsp;fire&nbsp;and&nbsp;the&nbsp;execution&nbsp;is&nbsp;locked.&nbsp;Make&nbsp;sure&nbsp;that&nbsp;comparisons&nbsp;are&nbsp;</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;*&nbsp;done&nbsp;with&nbsp;.equals&nbsp;and&nbsp;not&nbsp;with&nbsp;'=='&nbsp;because&nbsp;if&nbsp;executions&nbsp;are&nbsp;</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;*&nbsp;loaded&nbsp;from&nbsp;persistent&nbsp;storage,&nbsp;a&nbsp;new&nbsp;string&nbsp;is&nbsp;created&nbsp;instead&nbsp;</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;*&nbsp;of&nbsp;the&nbsp;constants.&nbsp;*/</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;String&nbsp;STATE_SUSPENDED&nbsp;=&nbsp;"suspended";</STRONG></DIV></DIV>
<DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG>&nbsp;&nbsp;/**&nbsp;is&nbsp;this&nbsp;execution&nbsp;suspended&nbsp;?&nbsp;*/</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;boolean&nbsp;isSuspended();</STRONG></DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; But these are just a constants for the suspended state and a method 
for obtain the condition of the execution. I see there is some javadoc for <A 
href="mailto:{@link">{@link</A> #suspend()}, it seems there may be a method 
named suspend in the Execution.java. But I can find any method like that.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; Finally I can only to use ExecutionImpl.java in pvm to complete the 
suspend() and resume() operation. I think there is totally wrong.</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/**</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;FIXME:&nbsp;It 
is wrong to use implement class.</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((ExecutionImpl)&nbsp;pi).suspend();</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG></STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/**</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;FIXME:&nbsp;It 
is wrong to use implement class.</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((ExecutionImpl)&nbsp;pi).resume();</STRONG></DIV></DIV>
<DIV><FONT face=Verdana size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp; Anyone has better solution for this? Thank you very much.</DIV>
<DIV>&nbsp;</DIV>
<DIV align=left><FONT face=Verdana color=#c0c0c0 size=2>2009-07-01 
</FONT></DIV><FONT face=Verdana size=2>
<HR style="WIDTH: 122px; HEIGHT: 2px" align=left SIZE=2>

<DIV><FONT face=Verdana color=#c0c0c0 size=2><SPAN>echo_o</SPAN> 
</FONT></DIV></FONT></BODY></HTML>