[jboss-user] [jBPM Development] - JBPM-2537

Maciej Swiderski do-not-reply at jboss.com
Wed May 5 04:48:24 EDT 2010


Maciej Swiderski [http://community.jboss.org/people/swiderski.maciej] replied to the discussion

"JBPM-2537"

To view the discussion, visit: http://community.jboss.org/message/541263#541263

--------------------------------------------------------------
Hi,

here comes my comments:
> HuiSheng Xu wrote:
>    We should add more information in here.  And the state constaints is defined in Task interface.  So should we move STATE_TIMEOUT and STATE_CANCELLED from HistoryTask to Task?
> 
>    Actually, the STATE_COMPLETED field in Task is duplicated by STATE_COMPLETED field in HistoryTask.
>  
> 
In my opinion Task and HistoryTask are two different entities and they should be kept separated.
States are defined in both places because they are used by different queries. So I think they should be as is.

> HuiSheng Xu wrote:
>   1.Should we modify TaskImpl.isComplete(), let this method fit additional states: 'timeout' and 'cancelled'.
> 
>      Now the isComplete() is like this:
> *public* *boolean* isCompleted() {
>     *if* (Task.STATE_COMPLETED.equals(state)) {
>       *return* *true*;
>     }
>     *if* ((Task.STATE_OPEN.equals(state)) || (Task.STATE_SUSPENDED.equals(state))) {
>       *return* *false*;
>     }
>     *return* *true*;
>   }
> 
I think this is only internal method and IMO it is about verifying if that was already completed in regular way. Timeout and cancel are not completion states, they just close the task and not complete it. That's why states for them are only for history purposes.

> HuiSheng Xu wrote:
> 
>   2. The content of TaskTimeout.java and TaskCancel.java is exactly the same.  The only difference of them is the completion state,  so should we make a abstract class, e.g. AbstractTaskCancel,  and let them inherit the superclass?
> 
Yeap, you are right here, they are quite the same. We could make an abstract class or shall we give it some thought and check if they should be the same?!

> HuiSheng Xu wrote:
> 
>   3. I notice that there is a jbpm.task.lifecycle.xml configution file in the classpath since jBPM-4.0.0-Alpha2,  and it contains the prossible states of task.  Should we modify it as well? or this configuration file is useless and should be removed in the future version?  The content of this file like below:
> <task-lifecycle initial="open">
>   <state name="open">
>     <transition name="complete" to="completed" />
>     <transition name="suspend" to="suspended" />
>     <transition name="cancel" to="cancelled" />
>   </state>
>   <state name="suspended">
>     <transition name="resume" to="open" />
>     <transition name="cancel" to="cancelled" />
>   </state>
>   <state name="cancelled" />
>   <state name="completed" />
> </task-lifecycle>
> 
I haven't seen it before, so thanks for pointing it out. I did look for it in the code but with the same result as Michael, no real references of it. They should not be used by custom code either since they are internal classes.

Thanks for your comments
Maciej

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/541263#541263]

Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100505/c8fc77d0/attachment.html 


More information about the jboss-user mailing list