<?xml version="1.0" encoding="UTF-8" ?>
<ServiceGroupRegistrations
  xmlns="http://mds.globus.org/servicegroup/client" 
  xmlns:sgc="http://mds.globus.org/servicegroup/client" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
  xmlns:agg="http://mds.globus.org/aggregator/types">

<!-- 
  Sample mds-servicegroup-add registration file for GT4 
  container DefaultTriggerService.

  This file shows an example of how to use the mds-servicegroup-add 
  program to configure the local DefaultTriggerService to 
  execute an action script when the ProcessorLoad/Last5Min 
  attribute value of the GLUECE resource property of GRAM PBS 
  ManagedJobFactoryService is equal to zero.  It assumes both
  Ganglia and PBS have been properly configured in the local installation.

  The trigger action is fired no more than once every 5 minutes and 
  the condition must be true for at least 4 minutes in order to be eligible to 
  fire. The ProcessorLoad/Last5Min attribute value is polled every 2 minutes.
  
  The trigger action script executed is the echo-trigger-action.sh 
  script, which echoes the the script standard input back as output.
  The output (i.e., the original script input) can then be viewed 
  as part of the actionOutput element of the TriggerStatusType for 
  the registered trigger by querying the DefaultTriggerService using 
  wsrf-query or wsrf-get-property, etc.

  If not refreshed, the registration (and any subsequent trigger action)
  will cease when the resource lifetime expires and the corresponding 
  trigger service group entry is destroyed, in this case about 20 minutes or 
  approximately twice the configured refresh interval. 

-->

<defaultServiceGroupEPR>
   <wsa:Address>https://myhost:8443/wsrf/services/DefaultTriggerService</wsa:Address>
</defaultServiceGroupEPR>

<ServiceGroupRegistrationParameters
   xmlns="http://mds.globus.org/servicegroup/client"
   xmlns:agg="http://mds.globus.org/aggregator/types"
   xmlns:trigger="http://mds.globus.org/2004/08/trigger/types">

    <RegistrantEPR
        xmlns:gram="http://www.globus.org/namespaces/2004/10/gram/job"
        xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
      <wsa:Address>
        https://myhost:8443/wsrf/services/ManagedJobFactoryService
      </wsa:Address>
      <wsa:ReferenceProperties>
         <gram:ResourceID>PBS</gram:ResourceID>
      </wsa:ReferenceProperties>
   </RegistrantEPR>

   <RefreshIntervalSecs>600</RefreshIntervalSecs>

   <Content xsi:type="agg:AggregatorContent"
            xmlns:agg="http://mds.globus.org/aggregator/types">

      <agg:AggregatorConfig xsi:type="agg:AggregatorConfig">
      
        <agg:GetResourcePropertyPollType 
            xmlns:glue="http://mds.globus.org/glue/ce/1.1" >
          <agg:PollIntervalMillis>120000</agg:PollIntervalMillis>
          <agg:ResourcePropertyName>glue:GLUECE</agg:ResourcePropertyName>
        </agg:GetResourcePropertyPollType>
         
        <trigger:TriggerRuleType>
          <trigger:matchingRule>//*/glue:GLUECE//glue:Host[glue:ProcessorLoad/@glue:Last5Min=0]</trigger:matchingRule>
	  <trigger:namespaceMappings>xmlns:glue=http://mds.globus.org/glue/ce/1.1</trigger:namespaceMappings>
          <trigger:actionScript>echo-trigger</trigger:actionScript>
          <trigger:minimumFiringInterval>300</trigger:minimumFiringInterval>
          <trigger:minimumMatchTime>240</trigger:minimumMatchTime>
	  <trigger:enableFilteredActionScriptInput>true</trigger:enableFilteredActionScriptInput>
	  <trigger:disableUnmodifiedActionScriptInput>true</trigger:disableUnmodifiedActionScriptInput>

          <!-- Sample Invalidity Time -->
<!-- 
          <trigger:invalidityTime>
            <trigger:startTime>2016-05-26T01:06:43Z</trigger:startTime>
            <trigger:endTime>2016-05-26T02:06:43Z</trigger:endTime>
          </trigger:invalidityTime>  

          <trigger:invalidityTime>
            <trigger:startTime>2016-05-26T08:08:50Z</trigger:startTime>
            <trigger:endTime>2016-05-26T09:09:50Z</trigger:endTime>
          </trigger:invalidityTime>
-->             
        </trigger:TriggerRuleType>

      </agg:AggregatorConfig>

      <agg:AggregatorData/>
   
   </Content>

</ServiceGroupRegistrationParameters>
</ServiceGroupRegistrations>

