You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/04/20 01:42:05 UTC

DO NOT REPLY [Bug 28481] New: - Can't call an activity from a step within a block

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28481>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28481

Can't call an activity from a step within a block

           Summary: Can't call an activity from a step within a block
           Product: Commons
           Version: 1.0 Alpha
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Sandbox
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: sharples@nz1.ibm.com


If you use CallStep to invoke another activity, and the CallStep is within a 
block, rather than directly underneath the activity, then you get a 
ClassCastException when the invoked activity returns. The offending piece of 
code is here in BaseContext.execute():

                // If there are active calls, resume the most recent one
                try {
                    nextStep = (Step) calls.pop();
                    this.activity = (Activity) nextStep.getOwner();
                } catch (EmptyStackException e) {
                    ; // Can not happen
                }
                continue;

It assumes that the owner of the next step is the original activity, whereas in 
fact it could be the next step in a block. I think that Step needs to have a 
separate findActivity() method, that will return the owning activity, searching 
upwards through the owner hierarchy until it finds the activity.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org