<?xml version="1.0" encoding="UTF-8"?>

<wsag:AgreementOffer 
xmlns:tns="http://www.w3.org/2005/08/addressing" 
xmlns:wsag="http://schemas.ggf.org/graap/2007/03/ws-agreement" 
xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2.xsd" 
xmlns:xml="http://www.w3.org/XML/1998/namespace" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:SLATest="https://in2test.lsi.uniovi.es/tools/SLACT/"
xsi:schemaLocation="http://schemas.ggf.org/graap/2007/03/ws-agreement">
  
  <wsag:Name>eHealth Scenario</wsag:Name>
  
  <wsag:Context>
    <wsag:ServiceProvider>AgreementInitiator</wsag:ServiceProvider>
    <wsag:ExpirationTime>2012-12-31T00:00:00</wsag:ExpirationTime>
  </wsag:Context>
  
  <wsag:Terms>
  	
  	<wsag:All>
  	
  	<wsag:All>
  	
  		<wsag:GuaranteeTerm wsag:Name="GT1" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSHealth">
         		<SLATest:Method>
              		<NameMethod>reportAlarm</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>alarmType</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>Emergency</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>lt</SLATest:operator>
        			<SLATest:constant>300</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>10</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
        
        <wsag:GuaranteeTerm wsag:Name="GT2" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSHealth">
         		<SLATest:Method>
              		<NameMethod>reportAlarm</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>alarmType</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>No Confirmation</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>lt</SLATest:operator>
        			<SLATest:constant>600</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>10</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
     
	</wsag:All>
        
    <wsag:All>
    
        <wsag:GuaranteeTerm wsag:Name="GT3" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSRegistry">
         		<SLATest:Method>
              		<NameMethod>getConnectedDeviceIP</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>alarmType</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>Emergency</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>lt</SLATest:operator>
        			<SLATest:constant>3</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>3</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
        
        <wsag:GuaranteeTerm wsag:Name="GT4" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSRegistry">
         		<SLATest:Method>
              		<NameMethod>getConnectedDeviceIP</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>alarmType</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>No Confirmation</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>lt</SLATest:operator>
        			<SLATest:constant>6</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>1</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
                
        <wsag:GuaranteeTerm wsag:Name="GT5" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSRegistry">
         		<SLATest:Method>
              		<NameMethod>getConnectedDeviceIP</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>count(list_of_professionals)</SLATest:variable>
        			<SLATest:operator>gt</SLATest:operator>
        			<SLATest:constant>0</SLATest:constant>
        			<SLATest:unit>professionals</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>5</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
        
        <wsag:GuaranteeTerm wsag:Name="GT6" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSRegistry">
         		<SLATest:Method>
              		<NameMethod>getConnectedDeviceIP</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>alarmType</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>Emergency</SLATest:constant>
        	</wsag:QualifyingCondition>
        	        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:expression>for all i (list_of_professionals(i) = doctor) </SLATest:expression>

        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	
        	<wsag:BusinessValueList/>  	        
        </wsag:GuaranteeTerm>
        
        <wsag:GuaranteeTerm wsag:Name="GT7" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSRegistry">
         		<SLATest:Method>
              		<NameMethod>getConnectedDeviceIP</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>alarmType</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>No Confirmation</SLATest:constant>
        	</wsag:QualifyingCondition>
        	        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:expression>for all i (list_of_professionals(i) = supervisor) </SLATest:expression>

        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	
        	<wsag:BusinessValueList/>  	         
        </wsag:GuaranteeTerm>
   
    </wsag:All>
        
    <wsag:ExactlyOne>
        
        <wsag:GuaranteeTerm wsag:Name="GT8" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSDoctor">
         		<SLATest:Method>
              		<NameMethod>receiveAlarm</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>deployedOn</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>MobileNode</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>le</SLATest:operator>
        			<SLATest:constant>6</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>2</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
        
        <wsag:GuaranteeTerm wsag:Name="GT9" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSDoctor">
         		<SLATest:Method>
              		<NameMethod>receiveAlarm</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>deployedOn</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>WiredServer</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>le</SLATest:operator>
        			<SLATest:constant>2</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>2</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
                
    </wsag:ExactlyOne>
        
    <wsag:ExactlyOne>
        
        <wsag:GuaranteeTerm wsag:Name="GT10" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSSupervisor">
         		<SLATest:Method>
              		<NameMethod>receiveAlarm</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>deployedOn</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>MobileNode</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>le</SLATest:operator>
        			<SLATest:constant>20</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>1.5</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
        
        <wsag:GuaranteeTerm wsag:Name="GT11" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSSupervisor">
         		<SLATest:Method>
              		<NameMethod>receiveAlarm</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>deployedOn</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>WiredServer</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>le</SLATest:operator>
        			<SLATest:constant>15</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>1.5</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
        
    </wsag:ExactlyOne>
        
    <wsag:All>
        
        <wsag:GuaranteeTerm wsag:Name="GT12" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSMedicalDevice">
         		<SLATest:Method>
              		<NameMethod>getMedicalDevices</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>le</SLATest:operator>
        			<SLATest:constant>2</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>1</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
        
        <wsag:GuaranteeTerm wsag:Name="GT13" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSMedicalDevice">
         		<SLATest:Method>
              		<NameMethod>getMeasure</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>idMedicalDevice</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>device_1</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>le</SLATest:operator>
        			<SLATest:constant>3</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>0.2</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
        
        <wsag:GuaranteeTerm wsag:Name="GT14" wsag:Obligated="ServiceProvider">
        	<wsag:ServiceScope wsag:ServiceName="WSMedicalDevice">
         		<SLATest:Method>
              		<NameMethod>getMeasure</NameMethod>
         		</SLATest:Method>
        	</wsag:ServiceScope>
        	
        	<wsag:QualifyingCondition>
        		<SLATest:variable>idMedicalDevice</SLATest:variable>
        		<SLATest:operator>eq</SLATest:operator>
        		<SLATest:constant>device_2</SLATest:constant>
        	</wsag:QualifyingCondition>
        
        	<wsag:ServiceLevelObjective>
        		<wsag:CustomServiceLevel>
        			<SLATest:variable>responseTime</SLATest:variable>
        			<SLATest:operator>le</SLATest:operator>
        			<SLATest:constant>10</SLATest:constant>
        			<SLATest:unit>seconds</SLATest:unit>
        		</wsag:CustomServiceLevel>
        	</wsag:ServiceLevelObjective>
        	        
        	<wsag:BusinessValueList>
        		<wsag:Penalty>
        			<wsag:AssessmentInterval>
              			<wsag:Count> 1 </wsag:Count>
            		</wsag:AssessmentInterval>
        			<wsag:ValueExpression>
        				<SLATest:constant>0.1</SLATest:constant>
        				<SLATest:unit>dollars</SLATest:unit>
        			</wsag:ValueExpression>
        		</wsag:Penalty>
        	</wsag:BusinessValueList>
        </wsag:GuaranteeTerm>
        
    </wsag:All>
        
  	</wsag:All>
  	
  </wsag:Terms>
  
</wsag:AgreementOffer>
