yawlfoundation / yawl

Yet Another Workflow Language
http://www.yawlfoundation.org
GNU Lesser General Public License v3.0
90 stars 35 forks source link

Reset Net's performRestriction() weirdness #637

Open nxsaken opened 3 years ago

nxsaken commented 3 years ago

Hi,

I'm trying to understand the reset net technique's implementation to compute the enablement of an OR-join. I've noticed that in E2WFOJNet's performRestriction() method, there is a check whether a restricted transition is a cancel transition. If it's true, restricted places are removed from the transition's remove set. However, the new remove set is not used after that. Is it supposed to be like that?

if (t.isCancelTransition()) {
  Set removeSet = new HashSet(t.getRemoveSet());
  removeSet.retainAll(restrictedPlaces);
} // removeSet unused
adamsmj commented 3 years ago

You have definitely found a bug. I contacted the original author of that code, but she can't remember anything about the logic flow, so we have to do a best guess based on context. It looks to me like what is supposed to happen there is the removal of any unrestricted places from the transition's cancel set. That is:

if (t.isCancelTransition()) {
  t.getRemoveSet().retainAll(restrictedPlaces);  // getRemoveSet() guaranteed not null
} 

So, that's how it is now in the repo.

I'll leave this open for a while for observation.