Insert an alert as an Oracle Service Bus customization file
<p>I am creating a customization file for OSB, and I would need to add an alert in this, so whenever it is loaded, the affected resources are modified to include those alerts.</p>

<p>So far I have followed instructions explained in <a href="http://docs.oracle.com/middleware/1221/osb/administer/GUID-6FBDE1BB-CAF5-40FC-BC88-D590828AB66C.htm#OSBAG2274" rel="nofollow">See Example - Adding and Deleting SLA Alert Rules</a>. I have created a customization file with the same structure than the example (actions - add - value), just changing the value for the alert or even using the one shown in the example.</p>

<p>Anyway, when I try to apply this customization file on OSB, I always get the error:<br>
org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
com.oracle.xmlns.servicebus.monitoring.alert.AlertRuleDocument</p>

<p>My customization file is:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;cus:Customizations xmlns:cus="http://www.bea.com/wli/config/customizations" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xt="http://www.bea.com/wli/config/xmltypes" xmlns:aler="http://www.bea.com/wli/monitoring/alert"&gt;
&lt;cus:customization xsi:type="cus:EnvValueActionsCustomizationType"&gt;
    &lt;cus:description&gt;Alertes Generals de ProxyService&lt;/cus:description&gt;
    &lt;cus:owners&gt;
        &lt;xt:ownerQuery&gt;          
            &lt;xt:resourceTypes&gt;ProxyService&lt;/xt:resourceTypes&gt;
            &lt;xt:refsToSearch xsi:type="xt:LocationRefType"&gt;
                &lt;xt:type&gt;Folder&lt;/xt:type&gt;
                &lt;xt:path&gt;bus_ver/EA&lt;/xt:path&gt;
            &lt;/xt:refsToSearch&gt;                                                       
        &lt;/xt:ownerQuery&gt;
    &lt;/cus:owners&gt;
    &lt;cus:actions&gt;
        &lt;xt:add&gt;
            &lt;xt:envValueType&gt;Service SLA Alert Rule&lt;/xt:envValueType&gt;
            &lt;xt:location&gt;AverageResponse&lt;/xt:location&gt;
            &lt;xt:value&gt;
                &lt;aler:alertRule enabled="true" name="prova"&gt;                        &lt;aler:description&gt;provades&lt;/aler:description&gt;                       &lt;aler:expirationDate&gt;2016-03-31+02:00&lt;/aler:expirationDate&gt;
                    &lt;aler:startTime&gt;00:00:00.000+01:00&lt;/aler:startTime&gt;
                    &lt;aler:endTime&gt;00:05:00.000+01:00&lt;/aler:endTime&gt;
                    &lt;aler:frequency&gt;every-time&lt;/aler:frequency&gt;
                    &lt;aler:severity&gt;normal&lt;/aler:severity&gt;
                    &lt;aler:stopProcessing&gt;false&lt;/aler:stopProcessing&gt;
                    &lt;aler:condition aggregation-interval="10"&gt;
                        &lt;con1:monCondExpr xmlns:con1="http://xmlns.oracle.com/servicebus/monitoring/alert/condition"&gt;
                            &lt;con1:function&gt;count&lt;/con1:function&gt;
                            &lt;con1:lhs&gt;Operation.peticionSincrona.error-count&lt;/con1:lhs&gt;
                            &lt;con1:operator&gt;=&lt;/con1:operator&gt;
                            &lt;con1:rhs&gt;1&lt;/con1:rhs&gt;
                        &lt;/con1:monCondExpr&gt;
                    &lt;/aler:condition&gt;
                    &lt;aler:alertDestination ref="bus_ver/AlertaProva"/&gt;
                &lt;/aler:alertRule&gt;
            &lt;/xt:value&gt;
        &lt;/xt:add&gt;
    &lt;/cus:actions&gt;
&lt;/cus:customization&gt;
&lt;/cus:Customizations&gt;
</code></pre>

<p>Does anyone know how to solve this or maybe I am doing something unproperly? </p>

<p>Thanks for your help.</p>