Ticket #300 (new defect)

Opened 3 years ago

Last modified 8 weeks ago

Messages are not always broadcast in correct order.

Reported by: RichardDavies Owned by: somebody
Priority: normal Milestone: 2.0.x-next-patch
Version: 2.0.304 Severity: normal
Keywords: Cc:

Description

The  documentation for the <broadcast> element states "The <message> tags will be broadcast in the order in which they are defined." It appears that this is not always true. All MG generic database messages are broadcast before any other messages, irregardless of the order they appear in ModelGlue?.xml.

For example, given the following ModelGlue?.xml:

<broadcasts>
	<message name="ModelGlue.GenericRead">
		...
	</message>
	<message name="customFunction" />
	<message name="ModelGlue.GenericList">
		...
	</message>
</broadcasts>

the messages should be broadcast in this order: GenericRead?, customFunction, GenericList?. But they are actually broadcast in this order: GenericRead?, GenericList?, customFunction.

The desired outcome would be to follow the documentation and broadcast the messages in the order that they appear in the config file.

Attachments

Change History

Changed 8 weeks ago by DanWilson

  • version set to 2.0
  • milestone set to 2.0.x-next-patch

This must only be a v2 thing. In V3 it works as intended. This means for this XML:

<event-handler name="page.index">

<broadcasts>

<message name="modelglue.GenericRead?">

<argument name="object" value="part" /> <argument name="criteria" value="partid" />

</message> <message name="doSomething" /> <message name="ModelGlue?.genericList">

<argument name="object" value="part" /> <argument name="criteria" value="" /> <argument name="queryName" value="partQuery" />

</message>

</broadcasts> <results>

<result do="template.main" />

</results> <views>

<include name="body" template="pages/index.cfm" />

</views>

</event-handler>

We get this result: 3789ms Event Handler Execute "page.index"

<event-handler name="page.index">

3789ms Message Broadcast Broadcasting "modelglue.GenericRead?"

<message name="modelglue.GenericRead?">

3790ms Message Listener Invoking genericRead in ModelGlue?.gesture.modules.orm.controller.GenericORMController

<message-listener message="modelglue.GenericRead?" function="genericRead" />

3873ms Message Broadcast Broadcasting "doSomething"

<message name="doSomething">

3874ms Message Listener Invoking doSomething in mgtest.controller.Controller

<message-listener message="doSomething" function="doSomething" />

3875ms Message Broadcast Broadcasting "ModelGlue?.genericList"

<message name="ModelGlue?.genericList">

3876ms Message Listener Invoking genericList in ModelGlue?.gesture.modules.orm.controller.GenericORMController

<message-listener message="ModelGlue?.genericList" function="genericList" />

Add/Change #300 (Messages are not always broadcast in correct order.)

Author


E-mail address and user name can be saved in the Preferences.


Action
as new
 
Note: See TracTickets for help on using tickets.