@@ -165,22 +165,10 @@ public fuml.semantics.activities.TokenList completeAction() {
165165 } // completeAction
166166
167167 public boolean isReady () {
168- // In addition to the default condition, check that, if the action has
169- // isLocallyReentrant=false, then the activation is not currently
170- // firing,
171- // and that the sources of all incoming edges (control flows) have
172- // offers and all input pin activations are ready.
173- // [This assumes that all edges directly incoming to the action are
174- // control flows.]
168+ // Check that the action is ready to fire, including
169+ // that all input pin activations are ready.
175170
176- boolean ready = super .isReady ()
177- & (((Action ) this .node ).isLocallyReentrant | !this .isFiring ());
178-
179- int i = 1 ;
180- while (ready & i <= this .incomingEdges .size ()) {
181- ready = this .incomingEdges .getValue (i - 1 ).hasOffer ();
182- i = i + 1 ;
183- }
171+ boolean ready = isControlReady ();
184172
185173 InputPinList inputPins = ((Action ) (this .node )).input ;
186174 int j = 1 ;
@@ -191,6 +179,25 @@ public boolean isReady() {
191179
192180 return ready ;
193181 } // isReady
182+
183+ public boolean isControlReady () {
184+ // In addition to the default condition for being ready, check that,
185+ // if the action has isLocallyReentrant=false, then the activation is
186+ // not currently firing, and that the sources of all incoming edges
187+ // have offers. (This assumes that all edges directly incoming to the
188+ // action are control flows.)
189+
190+ boolean ready = super .isReady ()
191+ & (((Action ) this .node ).isLocallyReentrant | !this .isFiring ());
192+
193+ int i = 1 ;
194+ while (ready & i <= this .incomingEdges .size ()) {
195+ ready = this .incomingEdges .getValue (i - 1 ).hasOffer ();
196+ i = i + 1 ;
197+ }
198+
199+ return ready ;
200+ }
194201
195202 public boolean isFiring () {
196203 // Indicate whether this action activation is currently firing or not.
@@ -206,7 +213,7 @@ public void sendOffers() {
206213 Action action = (Action ) (this .node );
207214
208215 // *** Send offers from all output pins concurrently. ***
209- OutputPinList outputPins = action . output ;
216+ OutputPinList outputPins = this . getOfferingOutputPins () ;
210217 for (Iterator i = outputPins .iterator (); i .hasNext ();) {
211218 OutputPin outputPin = (OutputPin ) i .next ();
212219 PinActivation pinActivation = this .getPinActivation (outputPin );
@@ -221,6 +228,15 @@ public void sendOffers() {
221228 this .outgoingEdges .getValue (0 ).sendOffer (tokens );
222229 }
223230 } // sendOffers
231+
232+ public OutputPinList getOfferingOutputPins () {
233+ // Return the output pins of the action of this action activation from
234+ // which offers are to be sent when the action activation finishes firing.
235+ // (This is normally all the output pins of the action, but it can be
236+ // overridden in subclasses to only return a subset of the output pins.)
237+
238+ return ((Action )this .node ).output ;
239+ }
224240
225241 public void createNodeActivations () {
226242 // Create node activations for the input and output pins of the action
0 commit comments