---
title: "protocols"
author: "turingfellow"
date: "2011-04-03T19:22:34Z"
tags: []
categories: ["编程语言"]
slug: "protocols"
draft: false
lastmod: "2011-04-03T19:22:34Z"
id: 985842
url: "https://turingfellow.iteye.com/blog/985842"
---

&lt;!--  
 The protocols capability enables an easy goal-driven usage of  
 some often used FIPA protocols.  
\--&gt;  
&lt;capability xmlns="[http://jadex.sourceforge.net/jadex](http://jadex.sourceforge.net/jadex)"  
 xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)"  
 xsi:schemaLocation="[http://jadex.sourceforge.net/jadex](http://jadex.sourceforge.net/jadex)  
                     [http://jadex.sourceforge.net/jadex-0.96.xsd](http://jadex.sourceforge.net/jadex-0.96.xsd)"  
 package="jadex.planlib"  
 name="Protocols"&gt;

 &lt;imports&gt;  
  &lt;import&gt;jadex.adapter.fipa.\*&lt;/import&gt;  
  &lt;import&gt;java.util.\*&lt;/import&gt;  
  &lt;import&gt;jadex.runtime.\*&lt;/import&gt;  
  &lt;import&gt;jadex.runtime.impl.\*&lt;/import&gt;  
 &lt;/imports&gt;

 &lt;beliefs&gt;  
  &lt;!-- Timeout for messages. --&gt;  
  &lt;belief name="timeout" class="Long" exported="true"&gt;  
   &lt;fact&gt;(Integer)$propertybase.getProperty("standard.timeout")&lt;/fact&gt;  
  &lt;/belief&gt;

  &lt;!-- Filters are only relevant for the participants protocol side. --&gt;

  &lt;!-- The filter for deciding which initial request messages are handled in this capability. --&gt;  
  &lt;belief name="rp\_filter" class="IFilter" exported="true"&gt;  
   &lt;fact&gt;IFilter.NEVER&lt;/fact&gt;  
  &lt;/belief&gt;

  &lt;!-- The filter for deciding which initial cfp messages are handled in this capability. --&gt;  
  &lt;belief name="cnp\_filter" class="IFilter" exported="true"&gt;  
   &lt;fact&gt;IFilter.NEVER&lt;/fact&gt;  
  &lt;/belief&gt;  
    
  &lt;!-- The filter for deciding which initial iterated cfp messages are handled in this capability. --&gt;  
  &lt;belief name="icnp\_filter" class="IFilter" exported="true"&gt;  
   &lt;fact&gt;IFilter.NEVER&lt;/fact&gt;  
  &lt;/belief&gt;  
    
  &lt;!-- The filter for deciding which initial cfp messages are handled in this capability. --&gt;  
  &lt;belief name="ea\_filter" class="IFilter" exported="true"&gt;  
   &lt;fact&gt;IFilter.NEVER&lt;/fact&gt;  
  &lt;/belief&gt;  
    
  &lt;!-- The filter for deciding which initial cfp messages are handled in this capability. --&gt;  
  &lt;belief name="da\_filter" class="IFilter" exported="true"&gt;  
   &lt;fact&gt;IFilter.NEVER&lt;/fact&gt;  
  &lt;/belief&gt;

  &lt;!-- The filter for deciding which cancel messages are handled in this capability. --&gt;  
  &lt;belief name="cm\_filter" class="IFilter" exported="true"&gt;  
   &lt;fact&gt;  
    new ComposedFilter(new IFilter\[]  
    {  
     $beliefbase.rp\_filter,  
     $beliefbase.cnp\_filter,  
     $beliefbase.icnp\_filter,  
     $beliefbase.ea\_filter,  
     $beliefbase.da\_filter  
    }, ComposedFilter.OR)  
   &lt;/fact&gt;  
  &lt;/belief&gt;  
 &lt;/beliefs&gt;

 &lt;goals&gt;  
   
  &lt;!-- FIPA request protocol. --&gt;

  &lt;!-- (Initiator side) Initiate a conversation using the fipa-request protocol. --&gt;  
  &lt;achievegoal name="rp\_initiate" exported="true"&gt;  
   &lt;!-- The receiver of the request. --&gt;  
   &lt;parameter name="receiver" class="AgentIdentifier"/&gt;  
   &lt;!-- The requested action. --&gt;  
   &lt;parameter name="action" class="Object"/&gt;  
   &lt;!-- Optional ontology for marshalling. --&gt;  
   &lt;parameter name="ontology" class="String" optional="true"/&gt;  
   &lt;!-- Optional language for marshalling. --&gt;  
   &lt;parameter name="language" class="String" optional="true"/&gt;  
   &lt;!-- The optional request timeout. --&gt;  
   &lt;parameter name="timeout" class="Long" optional="true"/&gt;  
   &lt;!-- The result of the request. --&gt;  
   &lt;parameter name="result" class="Object" direction="out"/&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
  &lt;/achievegoal&gt;

  &lt;!-- (Participant side) Request protocol interaction goal (top-level goal of all receiver-side interactions). --&gt;  
  &lt;performgoal name="rp\_receiver\_interaction" retry="false" exported="true"&gt;  
   &lt;!-- The message that initiated the protocol. --&gt;  
   &lt;parameter name="message" class="IMessageEvent"/&gt;  
   &lt;!-- The interaction description (content of first message). --&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"/&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The interaction result. --&gt;  
   &lt;parameter name="result" class="Object" direction="out"/&gt;  
  &lt;/performgoal&gt;

  &lt;!-- (Participant side) Decide upon a requested task will be executed. --&gt;  
  &lt;querygoal name="rp\_decide\_request" exported="true"&gt;  
   &lt;!-- The requested action. --&gt;  
   &lt;parameter name="action" class="Object"/&gt;  
   &lt;!-- The requesting agent. --&gt;  
   &lt;parameter name="initiator" class="AgentIdentifier"/&gt;  
   &lt;!-- True, if request should be done and agree message should be sent. --&gt;  
   &lt;parameter name="accept" class="Boolean" direction="out"/&gt;  
  &lt;/querygoal&gt;

  &lt;!-- (Participant side) Execute the requested task. --&gt;  
  &lt;achievegoal name="rp\_execute\_request" exported="true"&gt;  
   &lt;!-- The requested action. --&gt;  
   &lt;parameter name="action" class="Object"/&gt;  
   &lt;!-- The requesting agent. --&gt;  
   &lt;parameter name="initiator" class="AgentIdentifier"/&gt;  
   &lt;!-- The result of the request. --&gt;  
   &lt;parameter name="result" class="Object" direction="out" optional="true"/&gt;  
  &lt;/achievegoal&gt;

  &lt;!-- FIPA contract net protocol. --&gt;

  &lt;!-- (Initiator side) Initiate a call for proposal protcol. --&gt;  
  &lt;achievegoal name="cnp\_initiate" exported="true"&gt;  
   &lt;!-- The call-for-proposals is in the content. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The call-for-proposals info (local information). --&gt;  
   &lt;parameter name="cfp\_info" class="Object" direction="inout" optional="true"/&gt;  
   &lt;!-- Optional ontology for marshalling. --&gt;  
   &lt;parameter name="ontology" class="String" optional="true"/&gt;  
   &lt;!-- Optional langauge for marshalling. --&gt;  
   &lt;parameter name="language" class="String" optional="true"/&gt;  
   &lt;!-- The timeout used during the negotiation. --&gt;  
   &lt;parameter name="timeout" class="Long" optional="true"/&gt;  
   &lt;!-- If several proposals are acceptable, should all be accepted. --&gt;  
   &lt;parameter name="executeall" class="Boolean" optional="true"&gt;  
    &lt;value&gt;Boolean.FALSE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The (initial) negotiation participants. --&gt;  
   &lt;parameterset name="receivers" class="AgentIdentifier"/&gt;  
   &lt;!-- The tasks done by the winners. --&gt;  
   &lt;parameterset name="result" class="Object" direction="out"/&gt;  
   &lt;!-- The negotiation history. --&gt;  
   &lt;parameterset name="history" class="NegotiationRecord" optional="true" direction="out"/&gt;  
  &lt;/achievegoal&gt;  
    
  &lt;!-- (Initiator side) Evaluate the received proposals. --&gt;  
  &lt;querygoal name="cnp\_evaluate\_proposals" exported="true"&gt;  
   &lt;!-- The original call-for-proposals. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The call-for-proposals info (local information). --&gt;  
   &lt;parameter name="cfp\_info" class="Object" optional="true" direction="inout"/&gt;  
   &lt;!-- Dummy paramter that leads to goal completion, when an acceptable proposal is available or all proposals are evaluated. --&gt;  
   &lt;parameter name="evaluated" class="Boolean" direction="out"&gt;  
    &lt;value evaluationmode="dynamic"&gt;  
     ($goal.acceptables.length&gt;0 ||  
     (select one ParticipantProposal $prop from $goal.proposals  
     where $prop.getEvaluation()==null)==null) ? true : null  
    &lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The received proposals. --&gt;  
   &lt;parameterset name="proposals" class="ParticipantProposal"/&gt;  
   &lt;!-- The negotiation history. --&gt;  
   &lt;parameterset name="history" class="NegotiationRecord"/&gt;  
   &lt;!--  The acceptable proposals, sorted by preference (best proposal first). --&gt;  
   &lt;parameterset name="acceptables" class="ParticipantProposal" optional="true" direction="out"/&gt;  
  &lt;/querygoal&gt;

  &lt;!-- (Participant side) Contract-net protocol interaction goal (top-level goal of all receiver-side interactions). --&gt;  
  &lt;performgoal name="cnp\_receiver\_interaction" retry="false" exported="true"&gt;  
   &lt;!-- The message that initiated the protocol. --&gt;  
   &lt;parameter name="message" class="IMessageEvent"/&gt;  
   &lt;!-- The interaction description (content of first message). --&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"/&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The interaction result. --&gt;  
   &lt;parameter name="result" class="Object" direction="out"/&gt;  
  &lt;/performgoal&gt;

  &lt;!-- (Participant side) Make a cfp proposal. --&gt;  
  &lt;querygoal name="cnp\_make\_proposal" exported="true"&gt;  
   &lt;!-- The cfp describing the task to be done. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The initiator of the interaction. --&gt;  
   &lt;parameter name="initiator" class="AgentIdentifier"/&gt;  
   &lt;!-- The proposal for doing the task. --&gt;  
   &lt;parameter name="proposal" class="Object" direction="out"/&gt;  
   &lt;!-- Optional information about the task that will be tranferred  
   to the task execution step (not sent to initiator).--&gt;  
   &lt;parameter name="proposal\_info" class="Object" direction="out" optional="true"/&gt;  
  &lt;/querygoal&gt;

  &lt;!-- (Participant side) Execute a cfp task. --&gt;  
  &lt;achievegoal name="cnp\_execute\_task" exported="true"&gt;  
   &lt;!-- The proposal for doing the task. --&gt;  
   &lt;parameter name="proposal" class="Object"/&gt;  
   &lt;!-- Optional information about the task from the  
   preceding step (not sent to initiator).--&gt;  
   &lt;parameter name="proposal\_info" class="Object" optional="true"/&gt;  
   &lt;!-- The initiator of the interaction. --&gt;  
   &lt;parameter name="initiator" class="AgentIdentifier"/&gt;  
   &lt;!-- Information about the task execution. --&gt;  
   &lt;parameter name="result" class="Object" direction="out" optional="true"/&gt;  
  &lt;/achievegoal&gt;  
    
  &lt;!-- FIPA iterated contract net protocol. --&gt;

  &lt;!-- (Initiator side) Initiate a call for proposal protcol. --&gt;  
  &lt;achievegoal name="icnp\_initiate" exported="true"&gt;  
   &lt;!-- The call-for-proposals is in the content. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The call-for-proposals info (local information). --&gt;  
   &lt;parameter name="cfp\_info" class="Object" direction="inout" optional="true"/&gt;  
   &lt;!-- Optional ontology for marshalling. --&gt;  
   &lt;parameter name="ontology" class="String" optional="true"/&gt;  
   &lt;!-- Optional langauge for marshalling. --&gt;  
   &lt;parameter name="language" class="String" optional="true"/&gt;  
   &lt;!-- The timeout used during the negotiation. --&gt;  
   &lt;parameter name="timeout" class="Long" optional="true"/&gt;  
   &lt;!-- If several proposals are acceptable, should all be accepted. --&gt;  
   &lt;parameter name="executeall" class="Boolean" optional="true"&gt;  
    &lt;value&gt;Boolean.FALSE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The (initial) negotiation participants. --&gt;  
   &lt;parameterset name="receivers" class="AgentIdentifier"/&gt;  
   &lt;!-- The tasks done by the winners. --&gt;  
   &lt;parameterset name="result" class="Object" direction="out"/&gt;  
   &lt;!-- The negotiation history. --&gt;  
   &lt;parameterset name="history" class="NegotiationRecord" direction="out"/&gt;  
  &lt;/achievegoal&gt;  
    
  &lt;!-- (Initiator side) Evaluate the received proposals. --&gt;  
  &lt;querygoal name="icnp\_evaluate\_proposals" exported="true"&gt;  
   &lt;!-- The original call-for-proposals. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The call-for-proposals info (local information). --&gt;  
   &lt;parameter name="cfp\_info" class="Object" optional="true" direction="inout"/&gt;  
   &lt;!-- Dummy paramter that leads to goal completion, when an acceptable proposal is available or all proposals are evaluated. --&gt;  
   &lt;parameter name="evaluated" class="Boolean" direction="out"&gt;  
    &lt;value evaluationmode="dynamic"&gt;  
     ($goal.acceptables.length&gt;0 ||  
     (select one ParticipantProposal $prop from $goal.proposals  
     where $prop.getEvaluation()==null)==null) ? true : null  
    &lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The received proposals --&gt;  
   &lt;parameterset name="proposals" class="ParticipantProposal"/&gt;  
   &lt;!-- The negotiation history. --&gt;  
   &lt;parameterset name="history" class="NegotiationRecord"/&gt;  
   &lt;!-- The acceptable proposals, sorted by preference (best proposal first).  
     By default, setting acceptable proposals will end the protocol (i.e. no more iterations). --&gt;  
   &lt;parameterset name="acceptables" class="ParticipantProposal" optional="true" direction="out"/&gt;  
  &lt;/querygoal&gt;  
    
  &lt;!-- (Initiator side) Collect information for next round (if any). --&gt;  
  &lt;querygoal name="icnp\_nextround\_info" exported="true"&gt;  
   &lt;!-- The call-for-proposal object sent to participants (should be refined for next round). --&gt;  
   &lt;parameter name="cfp" class="Object" direction="inout"/&gt;  
   &lt;!-- The call-for-proposal info (local information, can be refined for next round). --&gt;  
   &lt;parameter name="cfp\_info" class="Object" optional="true" direction="inout"/&gt;  
   &lt;!-- Flag indicating the decision to iterate (set to true or false to end goal). --&gt;  
   &lt;parameter name="iterate" class="Boolean" direction="out"/&gt;  
   &lt;!-- The participants (can be altered for next negotiation round). --&gt;  
   &lt;parameterset name="participants" class="AgentIdentifier" direction="inout"/&gt;  
   &lt;!-- The proposals, received from participants including evaluation (if any). --&gt;  
   &lt;parameterset name="proposals" class="ParticipantProposal"/&gt;  
   &lt;!-- The negotiation history. --&gt;  
   &lt;parameterset name="history" class="NegotiationRecord"/&gt;  
  &lt;/querygoal&gt;

  &lt;!-- (Participant side) Iterated contract-net protocol interaction goal (top-level goal of all receiver-side interactions). --&gt;  
  &lt;performgoal name="icnp\_receiver\_interaction" retry="false" exported="true"&gt;  
   &lt;!-- The message that initiated the protocol. --&gt;  
   &lt;parameter name="message" class="IMessageEvent"/&gt;  
   &lt;!-- The interaction description (content of first message). --&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"/&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The interaction result. --&gt;  
   &lt;parameter name="result" class="Object" direction="out"/&gt;  
  &lt;/performgoal&gt;

  &lt;!-- (Participant side) Make a cfp proposal. --&gt;  
  &lt;querygoal name="icnp\_make\_proposal" exported="true"&gt;  
   &lt;!-- The cfp describing the task to be done. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The initiator of the interaction. --&gt;  
   &lt;parameter name="initiator" class="AgentIdentifier"/&gt;  
   &lt;!-- The proposal for doing the task. --&gt;  
   &lt;parameter name="proposal" class="Object" direction="out"/&gt;  
   &lt;!-- Optional information about the task that will be tranferred  
   to the task execution step (not sent to initiator).--&gt;  
   &lt;parameter name="proposal\_info" class="Object" direction="out" optional="true"/&gt;  
  &lt;/querygoal&gt;

  &lt;!-- (Participant side) Execute a cfp task. --&gt;  
  &lt;achievegoal name="icnp\_execute\_task" exported="true"&gt;  
   &lt;!-- The proposal for doing the task. --&gt;  
   &lt;parameter name="proposal" class="Object"/&gt;  
   &lt;!-- Optional information about the task from the  
   preceding step (not sent to initiator).--&gt;  
   &lt;parameter name="proposal\_info" class="Object" optional="true"/&gt;  
   &lt;!-- The initiator of the interaction. --&gt;  
   &lt;parameter name="initiator" class="AgentIdentifier"/&gt;  
   &lt;!-- Information about the task execution. --&gt;  
   &lt;parameter name="result" class="Object" direction="out" optional="true"/&gt;  
  &lt;/achievegoal&gt;  
    
  &lt;!-- FIPA english auction protocol. --&gt;

  &lt;!-- (Initiator side) Initiate the english auction protocol. --&gt;  
  &lt;achievegoal name="ea\_initiate" exported="true"&gt;  
   &lt;!-- The auction description containing necessary information about the auction:  
    a) the auction topic, b) the round timeout, c) the starttime (optional) --&gt;  
   &lt;parameter name="auction\_description" class="AuctionDescription"/&gt;  
   &lt;!-- The call-for-proposals is in the content. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The call-for-proposals info (local information). --&gt;  
   &lt;parameter name="cfp\_info" class="Object" optional="true"/&gt;  
   &lt;!-- The optional limit offer (if defined no ea\_decide\_acceptance goal is thrown). --&gt;  
   &lt;parameter name="limit" class="Comparable" optional="true"/&gt;  
   &lt;!-- Optional ontology for marshalling. --&gt;  
   &lt;parameter name="ontology" class="String" optional="true"/&gt;  
   &lt;!-- Optional language for marshalling. --&gt;  
   &lt;parameter name="language" class="String" optional="true"/&gt;  
   &lt;!-- The auction result. --&gt;  
   &lt;parameter name="result" class="Object" direction="out" optional="true"/&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The initially participating bidder agents. --&gt;  
   &lt;parameterset name="receivers" class="AgentIdentifier"/&gt;  
  &lt;/achievegoal&gt;  
    
  &lt;!-- (Initiator side) Decide if the next round should be executed and with which cfp. --&gt;  
  &lt;querygoal name="ea\_decide\_iteration" exported="true"&gt;  
   &lt;!-- Decide about the cfp for the next round. --&gt;  
   &lt;parameter name="cfp" class="Object" direction="out"/&gt;  
   &lt;!-- Decide about the (new) cfp info. --&gt;  
   &lt;parameter name="cfp\_info" class="Object" optional="true" direction="inout"/&gt;  
   &lt;!-- The history of cfps. --&gt;  
   &lt;parameterset name="history" class="Object"/&gt;  
  &lt;/querygoal&gt;  
    
  &lt;!-- (Initiator side) Decide if winning offer should be accepted. --&gt;  
  &lt;querygoal name="ea\_decide\_acceptance" exported="true"&gt;  
   &lt;!-- The auction description. --&gt;  
   &lt;parameter name="auction\_description" class="AuctionDescription"/&gt;  
   &lt;!-- The winning proposal --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The local cfp info --&gt;  
   &lt;parameter name="cfp\_info" class="Object" optional="true"/&gt;  
   &lt;!-- The winning agent. --&gt;  
   &lt;parameter name="winner" class="AgentIdentifier"/&gt;  
   &lt;!-- The result. --&gt;  
   &lt;parameter name="accept" class="Boolean" direction="out"/&gt;  
   &lt;!-- The history of cfps. --&gt;  
   &lt;parameterset name="history" class="Object"/&gt;  
  &lt;/querygoal&gt;  
    
  &lt;!-- (Participant side) English auction protocol interaction goal (top-level goal of all receiver-side interactions). --&gt;  
  &lt;performgoal name="ea\_receiver\_interaction" retry="false" exported="true"&gt;  
   &lt;!-- The message that initiated the protocol. --&gt;  
   &lt;parameter name="message" class="IMessageEvent"/&gt;  
   &lt;!-- The interaction description (content of first message). --&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"/&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The interaction result. --&gt;  
   &lt;parameter name="result" class="Object" direction="out"/&gt;  
  &lt;/performgoal&gt;  
    
  &lt;!-- (Participant side) Optional goal that offers a possibility to decide about participation. --&gt;    
  &lt;achievegoal name="ea\_decide\_participation" exported="true"&gt;  
   &lt;!-- The initiator of the interaction. --&gt;  
   &lt;parameter name="initiator" class="AgentIdentifier"/&gt;  
   &lt;!-- The auction info describing the auction. --&gt;  
   &lt;parameter name="auction\_description" class="AuctionDescription" direction="in"/&gt;  
   &lt;!-- Local auction info. --&gt;  
   &lt;parameter name="auction\_info" class="Object" optional="true" direction="out"/&gt;  
   &lt;!-- False for not participating in the auction. --&gt;  
   &lt;parameter name="participate" class="Boolean" direction="out"/&gt;  
  &lt;/achievegoal&gt;  
          
  &lt;!-- (Participant side) Make a proposal for an english auction. --&gt;  
  &lt;querygoal name="ea\_make\_proposal" exported="true"&gt;  
   &lt;!-- The current offer made by the auctioneer. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The auction description describing the auction. --&gt;  
   &lt;parameter name="auction\_description" class="AuctionDescription"/&gt;  
   &lt;!-- Local auction info. --&gt;  
   &lt;parameter name="auction\_info" class="Object" optional="true" direction="inout"/&gt;  
   &lt;!-- True, for accepting the offer. --&gt;  
   &lt;parameter name="accept" class="Boolean" direction="out"/&gt;  
   &lt;!-- True, for immediately leaving the current auction. --&gt;  
   &lt;parameter name="leave" class="Boolean" direction="out" optional="true"/&gt;  
   &lt;!-- The history of all offers in the auction. --&gt;  
   &lt;parameterset name="history" class="Object" optional="true"/&gt;  
  &lt;/querygoal&gt;  
    
  &lt;!-- FIPA dutch auction protocol. --&gt;

  &lt;!-- (Initiator side) Initiate the dutch auction protocol. --&gt;  
  &lt;achievegoal name="da\_initiate" exported="true"&gt;  
   &lt;!-- The auction description containing necessary information about the auction:  
    a) the auction topic, b) the round timeout, c) the starttime (optional) --&gt;  
   &lt;parameter name="auction\_description" class="AuctionDescription"/&gt;  
   &lt;!-- The current offer made by the auctioneer. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The call-for-proposals info (local information). --&gt;  
   &lt;parameter name="cfp\_info" class="Object" optional="true" direction="in"/&gt;  
   &lt;!-- Optional ontology for marshalling. --&gt;  
   &lt;parameter name="ontology" class="String" optional="true"/&gt;  
   &lt;!-- Optional language for marshalling. --&gt;  
   &lt;parameter name="language" class="String" optional="true"/&gt;  
   &lt;!-- The result of the protocol execution. --&gt;  
   &lt;parameter name="result" class="Object" optional="true" direction="out"/&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The initially participating bidder agents. --&gt;  
   &lt;parameterset name="receivers" class="AgentIdentifier"/&gt;  
  &lt;/achievegoal&gt;  
    
  &lt;!-- (Initiator side) Decide if the next round should be executed and with which cfp. --&gt;  
  &lt;querygoal name="da\_decide\_iteration" exported="true"&gt;  
   &lt;!-- Decide about the cfp for the next round. --&gt;  
   &lt;parameter name="cfp" class="Object" direction="out"/&gt;  
   &lt;!-- Decide about the (new) cfp info. --&gt;  
   &lt;parameter name="cfp\_info" class="Object" optional="true" direction="inout"/&gt;  
   &lt;!-- The history of cfps. --&gt;  
   &lt;parameterset name="history" class="Object"/&gt;  
  &lt;/querygoal&gt;  
      
  &lt;!-- (Participant side) Dutch auction protocol interaction goal (top-level goal of all receiver-side interactions). --&gt;  
  &lt;performgoal name="da\_receiver\_interaction" retry="false" exported="true"&gt;  
   &lt;!-- The message that initiated the protocol. --&gt;  
   &lt;parameter name="message" class="IMessageEvent"/&gt;  
   &lt;!-- The interaction description (content of first message). --&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"/&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The interaction result. --&gt;  
   &lt;parameter name="result" class="Object" direction="out"/&gt;  
  &lt;/performgoal&gt;  
    
  &lt;!-- (Participant side) Optional goal that offers a possibility to decide a participation. --&gt;    
  &lt;achievegoal name="da\_decide\_participation" exported="true"&gt;  
   &lt;!-- The initiator of the interaction. --&gt;  
   &lt;parameter name="initiator" class="AgentIdentifier"/&gt;  
   &lt;!-- The auction description. --&gt;  
   &lt;parameter name="auction\_description" class="AuctionDescription" direction="in"/&gt;  
   &lt;!-- Local auction info. --&gt;  
   &lt;parameter name="auction\_info" class="Object" optional="true" direction="out"/&gt;  
   &lt;!-- False for not participating in the auction. --&gt;  
   &lt;parameter name="participate" class="Boolean" direction="out"/&gt;  
  &lt;/achievegoal&gt;    
          
  &lt;!-- (Participant side) Accept a proposal in a dutch auction. --&gt;  
  &lt;querygoal name="da\_make\_proposal" exported="true"&gt;  
   &lt;!-- The current offer made by the auctioneer. --&gt;  
   &lt;parameter name="cfp" class="Object"/&gt;  
   &lt;!-- The auction description. --&gt;  
   &lt;parameter name="auction\_description" class="AuctionDescription"/&gt;  
   &lt;!-- Local auction info. --&gt;  
   &lt;parameter name="auction\_info" class="Object" optional="true" direction="inout"/&gt;  
   &lt;!-- True, for accepting the offer. --&gt;  
   &lt;parameter name="accept" class="Boolean" direction="out"/&gt;  
   &lt;!-- True, for immediately leaving the current auction. --&gt;  
   &lt;parameter name="leave" class="Boolean" direction="out" optional="true"/&gt;  
   &lt;!-- The history of all offers in the auction. --&gt;  
   &lt;parameterset name="history" class="Object" optional="true"/&gt;  
  &lt;/querygoal&gt;

  &lt;!-- FIPA-Cancel-Meta-Protocol goals. --&gt;

  &lt;!-- (Participant side) FIPA-Cancel-Meta-Protocol protocol interaction goal (top-level goal of all receiver-side interactions). --&gt;  
  &lt;performgoal name="cm\_receiver\_interaction" retry="false" exported="true"&gt;  
   &lt;!-- The message that initiated the protocol. --&gt;  
   &lt;parameter name="message" class="IMessageEvent"/&gt;  
   &lt;!-- The interaction description (content of first message). --&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"/&gt;  
   &lt;!-- The interaction state. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;value&gt;new InteractionState()&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- The interaction result. --&gt;  
   &lt;parameter name="result" class="Object" direction="out"/&gt;  
  &lt;/performgoal&gt;  
    
  &lt;!-- (Participant side) Optional goal to approve a cancel request (default=true). --&gt;  
  &lt;querygoal name="cm\_approve\_cancel" exported="true"&gt;  
   &lt;!-- The interaction to be cancelled. --&gt;  
   &lt;parameter name="conversation-id" class="String"/&gt;  
   &lt;!-- The protocol of the interaction to be cancelled. --&gt;  
   &lt;parameter name="protocol" class="String"/&gt;  
   &lt;!-- The initiator agent for the cancel request. --&gt;  
   &lt;parameter name="initiator" class="AgentIdentifier"/&gt;  
   &lt;!-- True, if the cancellation is ok. --&gt;  
   &lt;parameter name="result" class="Boolean" direction="out"/&gt;  
   &lt;!-- A failure reason when cancellation is not ok. --&gt;  
   &lt;parameter name="failure\_reason" class="Object" direction="out" optional="true"/&gt;  
  &lt;/querygoal&gt;

  &lt;!-- Generic goals. --&gt;

  &lt;!-- A subgoal that can be posted to trigger  to protocol specific  
    interaction handling. Should be used when implementing custom  
    plan for receiver interaction goal. --&gt;  
  &lt;performgoal name="perform\_interaction" retry="false" exported="true"&gt;  
   &lt;!-- The message should be assign from the superordinated goal. --&gt;  
   &lt;parameter name="message" class="IMessageEvent"/&gt;  
   &lt;!-- The interaction description (content of first message). --&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"/&gt;  
   &lt;!-- The interaction state should be assign from the superordinated goal. --&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"/&gt;  
   &lt;!-- The result should be passed back to the superordinated goal. --&gt;  
   &lt;parameter name="result" class="Object" direction="out"/&gt;  
  &lt;/performgoal&gt;

 &lt;/goals&gt;

 &lt;plans&gt;  
  &lt;!-- Generic interaction goal creation plan. --&gt;  
  &lt;plan name="rp\_interaction\_goal\_creation\_plan"&gt;  
   &lt;parameter name="goaltype" class="String"&gt;  
    &lt;value&gt;"rp\_receiver\_interaction"&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;body class="InteractionGoalCreationPlan" /&gt;  
   &lt;!-- &lt;body&gt;new InteractionGoalCreationPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;messageevent ref="rp\_request"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
    
  &lt;!-- Generic interaction goal creation plan. --&gt;  
  &lt;plan name="cnp\_interaction\_goal\_creation\_plan"&gt;  
   &lt;parameter name="goaltype" class="String"&gt;  
    &lt;value&gt;"cnp\_receiver\_interaction"&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;body class="InteractionGoalCreationPlan" /&gt;  
   &lt;!-- &lt;body&gt;new InteractionGoalCreationPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;messageevent ref="cnp\_cfp"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
    
  &lt;!-- Generic interaction goal creation plan. --&gt;  
  &lt;plan name="icnp\_interaction\_goal\_creation\_plan"&gt;  
   &lt;parameter name="goaltype" class="String"&gt;  
    &lt;value&gt;"icnp\_receiver\_interaction"&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;body class="InteractionGoalCreationPlan" /&gt;  
   &lt;!-- &lt;body&gt;new InteractionGoalCreationPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;messageevent ref="icnp\_cfp"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
    
  &lt;!-- Generic interaction goal creation plan. --&gt;  
  &lt;plan name="ea\_interaction\_goal\_creation\_plan"&gt;  
   &lt;parameter name="goaltype" class="String"&gt;  
    &lt;value&gt;"ea\_receiver\_interaction"&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;body class="InteractionGoalCreationPlan" /&gt;  
   &lt;!-- &lt;body&gt;new InteractionGoalCreationPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;messageevent ref="ea\_inform\_start\_auction"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
    
  &lt;!-- Generic interaction goal creation plan. --&gt;  
  &lt;plan name="da\_interaction\_goal\_creation\_plan"&gt;  
   &lt;parameter name="goaltype" class="String"&gt;  
    &lt;value&gt;"da\_receiver\_interaction"&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;body class="InteractionGoalCreationPlan" /&gt;  
   &lt;!-- &lt;body&gt;new InteractionGoalCreationPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;messageevent ref="da\_inform\_start\_auction"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
   
  &lt;plan name="request\_initiator\_plan"&gt;  
   &lt;parameter name="receiver" class="AgentIdentifier"&gt;  
    &lt;goalmapping ref="rp\_initiate.receiver"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="action" class="Object"&gt;  
    &lt;goalmapping ref="rp\_initiate.action"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="ontology" class="String"&gt;  
    &lt;goalmapping ref="rp\_initiate.ontology"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;goalmapping ref="rp\_initiate.language"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="timeout" class="Long"&gt;  
    &lt;goalmapping ref="rp\_initiate.timeout"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="result" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="rp\_initiate.result"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="rp\_initiate.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;body class="RPInitiatorPlan" /&gt;  
   &lt;!-- &lt;body&gt;new RPInitiatorPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="rp\_initiate"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;

  &lt;plan name="rp\_receiver\_plan" priority="-1"&gt;  
   &lt;parameter name="message" class="IMessageEvent"&gt;  
    &lt;goalmapping ref="rp\_receiver\_interaction.message"/&gt;  
    &lt;goalmapping ref="perform\_interaction.message"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="rp\_receiver\_interaction.interaction\_state"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="rp\_receiver\_interaction.interaction\_description"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_description"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="result" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="rp\_receiver\_interaction.result"/&gt;  
    &lt;goalmapping ref="perform\_interaction.result"/&gt;  
   &lt;/parameter&gt;  
   &lt;body class="RPReceiverPlan" /&gt;  
   &lt;!-- &lt;body&gt;new RPReceiverPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="rp\_receiver\_interaction"/&gt;  
    &lt;goal ref="perform\_interaction"&gt;  
     &lt;match&gt;SFipa.PROTOCOL\_REQUEST.equals($goal.message.getParameter(SFipa.PROTOCOL).getValue())&lt;/match&gt;  
    &lt;/goal&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;

  &lt;plan name="cnp\_initiator\_plan"&gt;  
   &lt;parameter name="iterated" class="Boolean"&gt;  
    &lt;value&gt;Boolean.FALSE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp" class="Object"&gt;  
    &lt;goalmapping ref="cnp\_initiate.cfp"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp\_info" class="Object"&gt;  
    &lt;goalmapping ref="cnp\_initiate.cfp\_info"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="ontology" class="String"&gt;  
    &lt;goalmapping ref="cnp\_initiate.ontology"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;goalmapping ref="cnp\_initiate.language"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="timeout" class="Long"&gt;  
    &lt;goalmapping ref="cnp\_initiate.timeout"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="executeall" class="boolean"&gt;  
    &lt;goalmapping ref="cnp\_initiate.executeall"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="cnp\_initiate.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameterset name="receivers" class="AgentIdentifier"&gt;  
    &lt;goalmapping ref="cnp\_initiate.receivers"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="result" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="cnp\_initiate.result"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="history" class="NegotiationRecord"&gt;  
    &lt;goalmapping ref="cnp\_initiate.history"/&gt;  
   &lt;/parameterset&gt;  
   &lt;body class="CNPInitiatorPlan" /&gt;  
   &lt;!-- &lt;body&gt;new CNPInitiatorPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="cnp\_initiate"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;

  &lt;!-- Default plan for evaluate proposals goal. --&gt;  
  &lt;plan name="cnp\_evaluateproposals\_plan" priority="-1"&gt;  
   &lt;parameter name="cfp" class="Object"&gt;  
    &lt;goalmapping ref="cnp\_evaluate\_proposals.cfp"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp\_info" class="Object"&gt;  
    &lt;goalmapping ref="cnp\_evaluate\_proposals.cfp\_info"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameterset name="proposals" class="ParticipantProposal"&gt;  
    &lt;goalmapping ref="cnp\_evaluate\_proposals.proposals"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="acceptables" class="ParticipantProposal" optional="true" direction="out"&gt;  
    &lt;goalmapping ref="cnp\_evaluate\_proposals.acceptables"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="history" class="NegotiationRecord"&gt;  
    &lt;goalmapping ref="cnp\_evaluate\_proposals.history"/&gt;  
   &lt;/parameterset&gt;  
   &lt;body class="CNPEvaluateProposalsPlan" /&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="cnp\_evaluate\_proposals"/&gt;  
   &lt;/trigger&gt;  
   &lt;precondition&gt;$goal.cfp\_info instanceof IProposalEvaluator&lt;/precondition&gt;  
  &lt;/plan&gt;

  &lt;plan name="cnp\_receiver\_plan"&gt;  
   &lt;parameter name="iterated" class="Boolean"&gt;  
    &lt;value&gt;Boolean.FALSE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="message" class="IMessageEvent"&gt;  
    &lt;goalmapping ref="cnp\_receiver\_interaction.message"/&gt;  
    &lt;goalmapping ref="perform\_interaction.message"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="cnp\_receiver\_interaction.interaction\_state"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="cnp\_receiver\_interaction.interaction\_description"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_description"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="result" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="cnp\_receiver\_interaction.result"/&gt;  
    &lt;goalmapping ref="perform\_interaction.result"/&gt;  
   &lt;/parameter&gt;  
   &lt;body class="CNPReceiverPlan" /&gt;  
   &lt;!-- &lt;body&gt;new CNPReceiverPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="cnp\_receiver\_interaction"/&gt;  
    &lt;goal ref="perform\_interaction"&gt;  
     &lt;match&gt;SFipa.PROTOCOL\_CONTRACT\_NET.equals($goal.message.getParameter(SFipa.PROTOCOL).getValue())&lt;/match&gt;  
    &lt;/goal&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
    
  &lt;plan name="icnp\_initiator\_plan"&gt;  
   &lt;parameter name="iterated" class="Boolean"&gt;  
    &lt;value&gt;Boolean.TRUE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp" class="Object"&gt;  
    &lt;goalmapping ref="icnp\_initiate.cfp"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp\_info" class="Object"&gt;  
    &lt;goalmapping ref="icnp\_initiate.cfp\_info"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="ontology" class="String"&gt;  
    &lt;goalmapping ref="icnp\_initiate.ontology"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;goalmapping ref="icnp\_initiate.language"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="timeout" class="Long"&gt;  
    &lt;goalmapping ref="icnp\_initiate.timeout"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="executeall" class="boolean"&gt;  
    &lt;goalmapping ref="icnp\_initiate.executeall"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="icnp\_initiate.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameterset name="receivers" class="AgentIdentifier"&gt;  
    &lt;goalmapping ref="icnp\_initiate.receivers"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="result" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="icnp\_initiate.result"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="history" class="NegotiationRecord"&gt;  
    &lt;goalmapping ref="icnp\_initiate.history"/&gt;  
   &lt;/parameterset&gt;  
   &lt;body class="CNPInitiatorPlan" /&gt;  
   &lt;!-- &lt;body&gt;new CNPInitiatorPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="icnp\_initiate"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;

  &lt;!-- Default plan for evaluate proposals goal. --&gt;  
  &lt;plan name="icnp\_evaluateproposals\_plan" priority="-1"&gt;  
   &lt;parameter name="cfp" class="Object"&gt;  
    &lt;goalmapping ref="icnp\_evaluate\_proposals.cfp"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp\_info" class="Object"&gt;  
    &lt;goalmapping ref="icnp\_evaluate\_proposals.cfp\_info"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameterset name="proposals" class="ParticipantProposal"&gt;  
    &lt;goalmapping ref="icnp\_evaluate\_proposals.proposals"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="acceptables" class="ParticipantProposal" optional="true" direction="out"&gt;  
    &lt;goalmapping ref="icnp\_evaluate\_proposals.acceptables"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="history" class="NegotiationRecord"&gt;  
    &lt;goalmapping ref="icnp\_evaluate\_proposals.history"/&gt;  
   &lt;/parameterset&gt;  
   &lt;body class="CNPEvaluateProposalsPlan" /&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="icnp\_evaluate\_proposals"/&gt;  
   &lt;/trigger&gt;  
   &lt;precondition&gt;$goal.cfp\_info instanceof IProposalEvaluator&lt;/precondition&gt;  
  &lt;/plan&gt;

  &lt;!-- Default plan for query nextround-info goal. --&gt;  
  &lt;plan name="icnp\_querynextroundinfo\_plan" priority="-1"&gt;  
   &lt;parameter name="cfp" class="Object"&gt;  
    &lt;goalmapping ref="icnp\_nextround\_info.cfp"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp\_info" class="Object" direction="inout"&gt;  
    &lt;goalmapping ref="icnp\_nextround\_info.cfp\_info"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="iterate" class="Boolean" direction="out"&gt;  
    &lt;goalmapping ref="icnp\_nextround\_info.iterate"/&gt;  
   &lt;/parameter&gt;     
   &lt;parameterset name="participants" class="AgentIdentifier" direction="inout"&gt;  
    &lt;goalmapping ref="icnp\_nextround\_info.participants"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="proposals" class="ParticipantProposal"&gt;  
    &lt;goalmapping ref="icnp\_nextround\_info.proposals"/&gt;  
   &lt;/parameterset&gt;  
   &lt;parameterset name="history" class="NegotiationRecord"&gt;  
    &lt;goalmapping ref="icnp\_nextround\_info.history"/&gt;  
   &lt;/parameterset&gt;  
   &lt;body class="CNPQueryNextroundInfoPlan" /&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="icnp\_nextround\_info"/&gt;  
   &lt;/trigger&gt;  
   &lt;precondition&gt;$goal.cfp\_info instanceof IQueryNextroundInfo&lt;/precondition&gt;  
  &lt;/plan&gt;

  &lt;plan name="icnp\_receiver\_plan"&gt;  
   &lt;parameter name="iterated" class="Boolean"&gt;  
    &lt;value&gt;Boolean.TRUE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="message" class="IMessageEvent"&gt;  
    &lt;goalmapping ref="icnp\_receiver\_interaction.message"/&gt;  
    &lt;goalmapping ref="perform\_interaction.message"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="icnp\_receiver\_interaction.interaction\_state"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="icnp\_receiver\_interaction.interaction\_description"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_description"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="result" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="icnp\_receiver\_interaction.result"/&gt;  
    &lt;goalmapping ref="perform\_interaction.result"/&gt;  
   &lt;/parameter&gt;  
   &lt;body class="CNPReceiverPlan" /&gt;  
   &lt;!-- &lt;body&gt;new CNPReceiverPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="icnp\_receiver\_interaction"/&gt;  
    &lt;goal ref="perform\_interaction"&gt;  
     &lt;match&gt;SFipa.PROTOCOL\_ITERATED\_CONTRACT\_NET.equals($goal.message.getParameter(SFipa.PROTOCOL).getValue())&lt;/match&gt;  
    &lt;/goal&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
    
  &lt;plan name="ea\_initiator\_plan"&gt;    
   &lt;parameter name="auction\_description" class="AuctionDescription"&gt;  
    &lt;goalmapping ref="ea\_initiate.auction\_description"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp" class="Object"&gt;  
    &lt;goalmapping ref="ea\_initiate.cfp"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp\_info" class="Object"&gt;  
    &lt;goalmapping ref="ea\_initiate.cfp\_info"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="limit" class="Comparable"&gt;  
    &lt;goalmapping ref="ea\_initiate.limit"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="ontology" class="String"&gt;  
    &lt;goalmapping ref="ea\_initiate.ontology"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;goalmapping ref="ea\_initiate.language"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="ea\_initiate.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="result" class="Object"&gt;  
    &lt;goalmapping ref="ea\_initiate.result"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameterset name="receivers" class="AgentIdentifier"&gt;  
    &lt;goalmapping ref="ea\_initiate.receivers"/&gt;  
   &lt;/parameterset&gt;  
   &lt;body class="EAInitiatorPlan" /&gt;  
   &lt;!-- &lt;body&gt;new EAInitiatorPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="ea\_initiate"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;    
      
  &lt;plan name="ea\_receiver\_plan" priority="-1"&gt;  
   &lt;parameter name="message" class="IMessageEvent"&gt;  
    &lt;goalmapping ref="ea\_receiver\_interaction.message"/&gt;  
    &lt;goalmapping ref="perform\_interaction.message"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="ea\_receiver\_interaction.interaction\_state"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="ea\_receiver\_interaction.interaction\_description"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_description"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="result" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="ea\_receiver\_interaction.result"/&gt;  
    &lt;goalmapping ref="perform\_interaction.result"/&gt;  
   &lt;/parameter&gt;  
   &lt;body class="EAReceiverPlan" /&gt;  
   &lt;!-- &lt;body&gt;new EAReceiverPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="ea\_receiver\_interaction"/&gt;  
    &lt;goal ref="perform\_interaction"&gt;  
     &lt;match&gt;SFipa.PROTOCOL\_ENGLISH\_AUCTION.equals($goal.message.getParameter(SFipa.PROTOCOL).getValue())&lt;/match&gt;  
    &lt;/goal&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
      
  &lt;plan name="da\_initiator\_plan"&gt;    
   &lt;parameter name="auction\_description" class="AuctionDescription"&gt;  
    &lt;goalmapping ref="da\_initiate.auction\_description"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp" class="Object"&gt;  
    &lt;goalmapping ref="da\_initiate.cfp"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="cfp\_info" class="Object"&gt;  
    &lt;goalmapping ref="da\_initiate.cfp\_info"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="ontology" class="String"&gt;  
    &lt;goalmapping ref="da\_initiate.ontology"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;goalmapping ref="da\_initiate.language"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="da\_initiate.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="result" class="Object"&gt;  
    &lt;goalmapping ref="da\_initiate.result"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameterset name="receivers" class="AgentIdentifier"&gt;  
    &lt;goalmapping ref="da\_initiate.receivers"/&gt;  
   &lt;/parameterset&gt;  
   &lt;body class="DAInitiatorPlan" /&gt;  
   &lt;!-- &lt;body&gt;new DAInitiatorPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="da\_initiate"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;    
    
  &lt;plan name="da\_receiver\_plan" priority="-1"&gt;  
   &lt;parameter name="message" class="IMessageEvent"&gt;  
    &lt;goalmapping ref="da\_receiver\_interaction.message"/&gt;  
    &lt;goalmapping ref="perform\_interaction.message"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_state" class="InteractionState" direction="out"&gt;  
    &lt;goalmapping ref="da\_receiver\_interaction.interaction\_state"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_state"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="interaction\_description" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="da\_receiver\_interaction.interaction\_description"/&gt;  
    &lt;goalmapping ref="perform\_interaction.interaction\_description"/&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="result" class="Object" direction="out"&gt;  
    &lt;goalmapping ref="da\_receiver\_interaction.result"/&gt;  
    &lt;goalmapping ref="perform\_interaction.result"/&gt;  
   &lt;/parameter&gt;  
   &lt;body class="DAReceiverPlan" /&gt;  
   &lt;!-- &lt;body&gt;new DAReceiverPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="da\_receiver\_interaction"/&gt;  
    &lt;goal ref="perform\_interaction"&gt;  
     &lt;match&gt;SFipa.PROTOCOL\_DUTCH\_AUCTION.equals($goal.message.getParameter(SFipa.PROTOCOL).getValue())&lt;/match&gt;  
    &lt;/goal&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
    
  &lt;!-- FIPA-Cancel-Meta-Protocol plans --&gt;  
    
  &lt;!-- FIPA-Cancel-Meta-Protocol generic interaction goal creation plan. --&gt;  
  &lt;plan name="cm\_interaction\_goal\_creation\_plan"&gt;  
   &lt;parameter name="goaltype" class="String"&gt;  
    &lt;value&gt;"cm\_receiver\_interaction"&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;body class="InteractionGoalCreationPlan" /&gt;  
   &lt;!-- &lt;body&gt;new InteractionGoalCreationPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;messageevent ref="cm\_cancel"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;    
    
  &lt;!-- Plan for cancelling an interaction (receiver side of FIPA-Cancel-Meta-Protocol). --&gt;  
  &lt;plan name="cm\_receiver\_plan"&gt;  
   &lt;parameter name="message" class="IMessageEvent"&gt;  
    &lt;goalmapping ref="cm\_receiver\_interaction.message"/&gt;  
    &lt;goalmapping ref="perform\_interaction.message"/&gt;  
   &lt;/parameter&gt;  
   &lt;body class="CMReceiverPlan" /&gt;  
   &lt;!-- &lt;body&gt;new CMReceiverPlan()&lt;/body&gt;--&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="cm\_receiver\_interaction"/&gt;  
    &lt;goal ref="perform\_interaction"&gt;  
     &lt;match&gt;SFipa.PROTOCOL\_CANCEL\_META.equals($goal.message.getParameter(SFipa.PROTOCOL).getValue())&lt;/match&gt;  
    &lt;/goal&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
    
  &lt;!-- Default plan for deciding about cancellation. --&gt;  
  &lt;plan name="cm\_approve\_cancel\_plan" priority="-1"&gt;  
   &lt;parameter name="result" class="boolean"&gt;  
    &lt;goalmapping ref="cm\_approve\_cancel.result"/&gt;  
   &lt;/parameter&gt;  
   &lt;body class="CMApproveCancelPlan" /&gt;  
   &lt;!-- &lt;body&gt;new CMApproveCancelPlan()&lt;/body&gt; --&gt;  
   &lt;trigger&gt;  
    &lt;goal ref="cm\_approve\_cancel"/&gt;  
   &lt;/trigger&gt;  
  &lt;/plan&gt;  
    
 &lt;/plans&gt;

 &lt;events&gt;  
  &lt;messageevent name="rp\_request" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.REQUEST&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_REQUEST&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="conversation-id" class="String"&gt;  
    &lt;value&gt;SFipa.createUniqueId($scope.getAgentName())&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!--&lt;parameter name="reply-with" class="String"&gt;  
    &lt;value&gt;SFipa.createUniqueId($scope.getAgentName())&lt;/value&gt;  
   &lt;/parameter&gt;--&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;match&gt;$beliefbase.rp\_filter.filter($messagemap) &amp;&amp; $messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messageevent&gt;

  &lt;messageevent name="rp\_agree" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.AGREE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_REQUEST&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
    &lt;/parameter&gt;  
    &lt;match&gt;$messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messageevent&gt;

  &lt;messageevent name="rp\_refuse" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.REFUSE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_REQUEST&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
    &lt;/parameter&gt;  
    &lt;match&gt;$messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messageevent&gt;

  &lt;messageevent name="rp\_failure" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.FAILURE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_REQUEST&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
    &lt;/parameter&gt;  
    &lt;match&gt;$messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messageevent&gt;

  &lt;messageevent name="rp\_not\_understood" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.NOT\_UNDERSTOOD&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_REQUEST&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
    &lt;/parameter&gt;  
    &lt;match&gt;$messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messageevent&gt;

  &lt;messageevent name="rp\_inform" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.INFORM&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_REQUEST&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
    &lt;/parameter&gt;  
    &lt;match&gt;$messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messageevent&gt;

  &lt;!--- cnp --&gt;

  &lt;messageevent name="cnp\_cfp" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.CFP&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_CONTRACT\_NET&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!-- hmm inout needed to read it in plan :-( --&gt;  
   &lt;parameter name="conversation-id" class="String" direction="inout"&gt;  
    &lt;value&gt;SFipa.createUniqueId($scope.getAgentName())&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;!--&lt;parameter name="reply-with" class="String"&gt;  
    &lt;value&gt;SFipa.createUniqueId($scope.getAgentName())&lt;/value&gt;  
   &lt;/parameter&gt;--&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
    &lt;/parameter&gt;  
   &lt;match&gt;$beliefbase.cnp\_filter.filter($messagemap) &amp;&amp; $messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messageevent&gt;

  &lt;messageevent name="cnp\_propose" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROPOSE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_CONTRACT\_NET&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
    &lt;/parameter&gt;  
    &lt;match&gt;$messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messageevent&gt;

  &lt;messageevent name="cnp\_refuse" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.REFUSE&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_CONTRACT\_NET&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
    &lt;/parameter&gt;  
    &lt;match&gt;$messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messageevent&gt;

  &lt;messageevent name="cnp\_reject" type="fipa" exported="true"&gt;  
   &lt;parameter name="performative" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.REJECT\_PROPOSAL&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="protocol" class="String" direction="fixed"&gt;  
    &lt;value&gt;SFipa.PROTOCOL\_CONTRACT\_NET&lt;/value&gt;  
   &lt;/parameter&gt;  
   &lt;parameter name="language" class="String"&gt;  
    &lt;value&gt;SFipa.NUGGETS\_XML&lt;/value&gt;  
    &lt;/parameter&gt;  
    &lt;match&gt;$messagemap.get("$conversation\_id")!=null&lt;/match&gt;  
  &lt;/messag