Is there an easy way to send a message from one agent to another containing more than one piece of information?
For example, I send a "order" message from a customer to a vendor. This order message should contain the
customerID, the number of products needed as well as the order priority (low, medium or high).
Do I need to define a new Java class for this type of message?
Pavel — 07.09.09
Hi Chris,
Yes, you're right. You should create new Java class and use its instances to send information from one agent to another.
stan — 01.08.10
Hi,
In that case, how to access the different fields of the message ?
e.g. on message received : traceln(msg.customerID) does not work.
Victor — 04.08.10
Stan, you should use the casting operator in this field. As far as the msg variable available in this field has Object
type, you should cast it to your type in this way: ((YouClassName) msg).yourFieldName