<!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> </DIV>
<DIV> I have a big problem when suspending/resuming a
ProcessInstance in jBPM4.</DIV>
<DIV> 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> </DIV>
<DIV> 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> </DIV>
<DIV>
<DIV><STRONG> /** indicates that this execution is temporary suspended with the</STRONG></DIV>
<DIV><STRONG> * {@link #suspend()} method. Human tasks of a suspended execution</STRONG></DIV>
<DIV><STRONG> * shouldn't show up in people's task list and timers of suspended</STRONG></DIV>
<DIV><STRONG> * executions shouldn't fire and the execution is locked. Make sure that comparisons are </STRONG></DIV>
<DIV><STRONG> * done with .equals and not with '==' because if executions are </STRONG></DIV>
<DIV><STRONG> * loaded from persistent storage, a new string is created instead </STRONG></DIV>
<DIV><STRONG> * of the constants. */</STRONG></DIV>
<DIV><STRONG> String STATE_SUSPENDED = "suspended";</STRONG></DIV></DIV>
<DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG> /** is this execution suspended ? */</STRONG></DIV>
<DIV><STRONG> boolean isSuspended();</STRONG></DIV></DIV>
<DIV> </DIV>
<DIV> 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> </DIV>
<DIV> 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> </DIV>
<DIV>
<DIV><STRONG> /**</STRONG></DIV>
<DIV><STRONG> * FIXME: It
is wrong to use implement class.</STRONG></DIV>
<DIV><STRONG> */</STRONG></DIV>
<DIV><STRONG> ((ExecutionImpl) pi).suspend();</STRONG></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG></STRONG></DIV>
<DIV><STRONG> /**</STRONG></DIV>
<DIV><STRONG> * FIXME: It
is wrong to use implement class.</STRONG></DIV>
<DIV><STRONG> */</STRONG></DIV>
<DIV><STRONG> ((ExecutionImpl) pi).resume();</STRONG></DIV></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV> Anyone has better solution for this? Thank you very much.</DIV>
<DIV> </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>