Error adding extra processor to input channel in 103-CQL-Processor Lab - Complex Event Processing

I've carried out the steps in the 103-CQL-Processor lab but I can't sort out this last error. Could you help? Thanks Dominic
A channel related to this processor does not specify a required event type. This problem will prevent queries for this processor configuration element from being validated.     com.oracle.cep.training.jaxb/META-INF/wlevs     MeterFlickerProcessor.xml     
<?xml version="1.0" encoding="UTF-8"?>
<wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application">
<processor>
<name>MeterFlickerProcessor</name>
<rules>
<query id="FlickerQuery">
          <![CDATA[                  
               SELECT
                         flicker.meterId as meterId,
                         flicker.flickerTime as flickerTime
                         FROM MeterStateInputChannel MATCH_RECOGNIZE
                         (
                         PARTITION BY
                             meterId                         
                         MEASURES
                              PowerDown.meterId AS meterId,
                              PowerDown.statusTime as flickerTime               
                         PATTERN (PowerDown PowerUp)
                         DEFINE
                              PowerDown AS state = 'POWER_DOWN',
                              PowerUp AS state = 'POWER_UP'                                                            
                         ) AS flicker
          ]]>
          </query>
</rules>
</processor>
</wlevs:config> 

Just an IDE glitch as ok now. 

OCEP errors in XML files will hang around until you either (A) save the file or (B) explicitly invoke validation on the file (e.g. by right clicking and selecting "Validate") or (C) explicitly invoking validation on the project (e.g. by right clicking on the project in the project explorer and selecting "Validate"). It's somewhat unfortunate that you have to do this, but it's because that's how XML validators work in Eclipse. The reasoning is that validation can be expensive, so if validation were constantly running it could slow the IDE down.
In this case, it looks like a channel upstream or downstream of your processor didn't have an event type declared for it, triggering this error. You may have fixed it, but you needed to do either A, B, or C to get the error to go away. After I make EPN changes, I like to do option C to make sure I didn't screw up any CQL statements.
I hope this insight helps.

Related

Extract XML fragment without namespace

Hi I need to do some XML manipulation and for the PL/SQL block below the extracted xml has added namespaces to the tags ie  it is this  <g:EntityId xmlns:g="http://www.something/Entity/Core/V1.0"> instead of this   <g:EntityId> Is there any way to stop this, or if not then I assume I will need to use string/clob functions to extract the relevant portion? declarev_request     naps.soap_api.t_request;v_response      soap_api.t_response;v_body           CLOB;v_tmpXML         XMLType;  BEGINv_tmpXML := XMLTYPE('<GetEntitySummaryResponse xmlns:a="http://www.something/Accreditation/Core/V1.0" xmlns:b="http://www.something/Address/Core/V1.0" xmlns:c="http://www.something/AgedCareServiceProvider/Core/V1.0" xmlns:d="http://www.something/Contact/Core/V1.0" xmlns:e="http://www.something/Data/Services/V1.0" xmlns:f="http://www.something/Enterprise/Core/V1.0" xmlns:g="http://www.something/Entity/Core/V1.0" xmlns:h="http://www.something/Integration/Notification/Services/Data/Entity/V1.0" xmlns:i="http://www.something/Messaging/Core/V1.0" xmlns:j="http://www.something/Name/Core/V1.0" xmlns:k="http://www.something/Organisation/Core/V1.0" xmlns:l="http://www.something/Person/Core/V1.0" xmlns:m="http://www.something/Prudential/Core/V1.0" xmlns:n="http://www.something/ServiceOffering/Core/V1.0" xmlns:o="http://www.something/Site/Core/V1.0" xmlns:p="http://www.something/Status/Core/V1.0">            <i:DataGroup>address</i:DataGroup>            <f:Id>               <f:Value>169</f:Value>               <f:Type>Address.Id</f:Type>               <f:Qualifier>ADDRESSES</f:Qualifier>            </f:Id>            <b:Address>               <g:EntityId>                  <g:EntityTypes>                     <g:EntityType>Address</g:EntityType>                  </g:EntityTypes>                  <g:Identifiers>                     <g:Identifier>                        <g:Value>169</g:Value>                     </g:Identifier>                  </g:Identifiers>               </g:EntityId>               <b:AddressLine1>"Karoo"</b:AddressLine1>               <b:SiteName>"Karoo"</b:SiteName>               <b:Suburb>JINGELLIC</b:Suburb>               <b:AddressTenancies>                  <b:AddressTenancy>Physical</b:AddressTenancy>               </b:AddressTenancies>            </b:Address>         </GetEntitySummaryResponse>');       v_tmpXML := v_tmpXML.extract('/GetEntitySummaryResponse/b:Address',                                     'xmlns:p="http://www.something/Integration/Notification/Services/Data/Entity/V1.0" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.something/Accreditation/Core/V1.0" xmlns:b="http://www.something/Address/Core/V1.0" xmlns:c="http://www.something/AgedCareServiceProvider/Core/V1.0" xmlns:d="http://www.something/Contact/Core/V1.0" xmlns:e="http://www.something/Data/Services/V1.0" xmlns:f="http://www.something/Enterprise/Core/V1.0" xmlns:g="http://www.something/Entity/Core/V1.0" xmlns:h="http://www.something/Integration/Notification/Services/Data/Entity/V1.0" xmlns:i="http://www.something/Messaging/Core/V1.0" xmlns:j="http://www.something/Name/Core/V1.0" xmlns:k="http://www.something/Organisation/Core/V1.0" xmlns:l="http://www.something/Person/Core/V1.0" xmlns:m="http://www.something/Prudential/Core/V1.0" xmlns:n="http://www.something/ServiceOffering/Core/V1.0" xmlns:o="http://www.something/Site/Core/V1.0" xmlns:p="http://www.something/Status/Core/V1.0"');   dbms_output.put_line(v_tmpXML.getClobVal());  end ;
Is there any way to stop this, or if not then I assume I will need to use string/clob functions to extract the relevant portion?
You're getting the correct result. Nothing was added, the namespace was there all the time.If you want to get <g:EntityId> without any declaration of the prefix "g", then it's invalid XML. Could you clarify your requirement?Do you want to strip all namespaces from the fragment? BTW, you don't have to specify the full list of namespaces in the EXTRACT function, just use the one(s) you need to resolve the XPath expression.
I basically have to take an xml I'm receiving from another system, strip out the data block and wrap it in something else. The namespaces of the two xml are essentially the same structure so I just want to grab a part of the first xml as is and put it in the second one. In a way it sounds like I should just be using string functions rather than xml.functions.
so I just want to grab a part of the first xml as is and put it in the second one. In a way it sounds like I should just be using string functions rather than xml.functions.
What's your database version? A combination of extract/insertChildXML functions can do that easily in versions prior to 11.2.0.3, or XQuery Update starting with 11.2.0.3.
It's Version 10.2.0.4.0, though thinking about it I think now I think I'll need to use some string functions as I need to do some XML unfriendly type operations on the fragment.
as I need to do some XML unfriendly type operations on the fragment.
Such as ?Give specific examples please, we'll tell you if it's possible with XML-related functions Thanks.
Well, I'm not sure as it matters as I'm pretty sure the project is in a death spiral but: This is a response I get from an internally developed webservice that describes an entity  <p:getEntitySummaryResponse xmlns:p="http://www.cars.ccc/Namespace/Integration/Notification/Services/Data/Entity/V1.0">  <GetEntitySummaryResponse xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.cars.ccc/Namespace/Accreditation/Core/V1.0" xmlns:b="http://www.cars.ccc/Namespace/Address/Core/V1.0" xmlns:c="http://www.cars.ccc/Namespace/AgedCareServiceProvider/Core/V1.0" xmlns:d="http://www.cars.ccc/Namespace/Contact/Core/V1.0" xmlns:e="http://www.cars.ccc/Namespace/Data/Services/V1.0" xmlns:f="http://www.cars.ccc/Namespace/Enterprise/Core/V1.0" xmlns:g="http://www.cars.ccc/Namespace/Entity/Core/V1.0" xmlns:h="http://www.cars.ccc/Namespace/Integration/Notification/Services/Data/Entity/V1.0" xmlns:i="http://www.cars.ccc/Namespace/Messaging/Core/V1.0" xmlns:j="http://www.cars.ccc/Namespace/Name/Core/V1.0" xmlns:k="http://www.cars.ccc/Namespace/Organisation/Core/V1.0" xmlns:l="http://www.cars.ccc/Namespace/Person/Core/V1.0" xmlns:m="http://www.cars.ccc/Namespace/Prudential/Core/V1.0" xmlns:n="http://www.cars.ccc/Namespace/ServiceOffering/Core/V1.0" xmlns:o="http://www.cars.ccc/Namespace/Site/Core/V1.0" xmlns:p="http://www.cars.ccc/Namespace/Status/Core/V1.0">    <i:DataGroup>address</i:DataGroup>    <f:Id>      <f:Value>69</f:Value>      <f:Type>CDM.Address.Id</f:Type>      <f:Qualifier>ADDRESSES</f:Qualifier>    </f:Id>**********************************************************    <b:Address>      <g:EntityId>        <g:EntityTypes>          <g:EntityType>CDM.Address</g:EntityType>        </g:EntityTypes>        <g:Identifiers>          <g:Identifier>            <f:EffectiveStartTime>2002-07-31T00:00:00.000+10:00</f:EffectiveStartTime>            <g:Qualifier>ADDRESSES</g:Qualifier>            <g:Value>69</g:Value>            <g:IdentifierType>CDM.Address.Id</g:IdentifierType>          </g:Identifier>        </g:Identifiers>      </g:EntityId>      <b:AddressLine1>"Karoo"</b:AddressLine1>      <b:SiteName>"Karoo"</b:SiteName>      <b:StateCode>NSW</b:StateCode>      <b:Postcode>2642</b:Postcode>      <b:Suburb>JINGELLIC</b:Suburb>      <b:AddressTenancies>        <b:AddressTenancy>          <g:EntityId>            <g:EntityTypes>              <g:EntityType>CDM.AddressTenancy</g:EntityType>            </g:EntityTypes>            <g:Identifiers>              <g:Identifier>                <f:EffectiveStartTime>2002-07-31T00:00:00.000+10:00</f:EffectiveStartTime>                <g:Qualifier>ENY_ADDRESSES</g:Qualifier>                <g:Value>71</g:Value>                <g:IdentifierType>CDM.AddressTenancy.Id</g:IdentifierType>              </g:Identifier>            </g:Identifiers>          </g:EntityId>          <b:AddressReference>            <g:EntityTypes>              <g:EntityType>CDM.Address</g:EntityType>            </g:EntityTypes>            <g:Identifiers>              <g:Identifier>                <f:EffectiveStartTime>2002-07-31T00:00:00.000+10:00</f:EffectiveStartTime>                <g:Qualifier>ADDRESSES</g:Qualifier>                <g:Value>69</g:Value>                <g:IdentifierType>CDM.Address.Id</g:IdentifierType>              </g:Identifier>            </g:Identifiers>          </b:AddressReference>          <b:Tenant>            <g:EntityTypes>              <g:EntityType>CDM.Person</g:EntityType>            </g:EntityTypes>            <g:Identifiers>              <g:Identifier>                <f:EffectiveStartTime>2002-07-31T00:00:00.000+10:00</f:EffectiveStartTime>                <g:Qualifier>ENY_ADDRESSES</g:Qualifier>                <g:Value>16951</g:Value>                <g:IdentifierType>CDM.Person.Id</g:IdentifierType>              </g:Identifier>            </g:Identifiers>          </b:Tenant>          <b:Usage>Residential</b:Usage>        </b:AddressTenancy>      </b:AddressTenancies>    </b:Address>**********************************************************  </GetEntitySummaryResponse></p:getEntitySummaryResponse>  I need to extract the bit between the ********************************************************** and put it into this xml <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"                 xmlns:v1="http://www.cars.ccc/Namespace/BS/AddressService/V1.0"                 xmlns:v11="http://www.cars.ccc/Namespace/Notification/Core/V1.0"                 xmlns:v12="http://www.cars.ccc/Namespace/Messaging/Core/V1.0"                 xmlns:v13="http://www.cars.ccc/Namespace/Entity/Core/V1.0"                 xmlns:v14="http://www.cars.ccc/Namespace/Enterprise/Core/V1.0"                 xmlns:v15="http://www.cars.ccc/Namespace/Name/Core/V1.0"                 xmlns:v16="http://www.cars.ccc/Namespace/Address/Core/V1.0"><soap:Header /><soap:Body><v1:notifyAddress><AddressNotificationRequest><v11:EventSource>NABS</v11:EventSource><v11:EventDateTime>2013-10-16T17:10:24</v11:EventDateTime><v11:ChangeSummary><v11:ChangeType>Update</v11:ChangeType><v12:DataGroup>address</v12:DataGroup></v11:ChangeSummary>........                                <----- insert here</AddressNotificationRequest></v1:notifyAddress></soap:Body></soap:Envelope>  The first xml uses a,b,c,d,e,... as namespace prefixes which are set by an IBM Java component used for webservices. Apparently the prefixes cannot be fixed by the developer and are autogenerated by the IBM component. I've also been told the prefixes assigned may change if updates are applied to their server, so ideally hardcoding of the namespaces prefixes shouldn't be done, though I may store them in a user updateable table. When I extract the portion from the first xml I need to change the namespaces prefixes to match the prefixes in the second xml, e.g First XML       xmlns:g="http://www.cars.ccc/Namespace/Entity/Core/V1.0" Second XML   xmlns:v13="http://www.cars.ccc/Namespace/Entity/Core/V1.0"  mean I have to change the prefix g to v13 when inserting it into the second xml. So the end result should be : <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"                 xmlns:v1="http://www.cars.ccc/Namespace/BS/AddressService/V1.0"                 xmlns:v11="http://www.cars.ccc/Namespace/Notification/Core/V1.0"                 xmlns:v12="http://www.cars.ccc/Namespace/Messaging/Core/V1.0"                 xmlns:v13="http://www.cars.ccc/Namespace/Entity/Core/V1.0"                 xmlns:v14="http://www.cars.ccc/Namespace/Enterprise/Core/V1.0"                 xmlns:v15="http://www.cars.ccc/Namespace/Name/Core/V1.0"                 xmlns:v16="http://www.cars.ccc/Namespace/Address/Core/V1.0"><soap:Header /><soap:Body><v1:notifyAddress><AddressNotificationRequest><v11:EventSource>NABS</v11:EventSource><v11:EventDateTime>2013-10-16T17:10:24</v11:EventDateTime><v11:ChangeSummary><v11:ChangeType>Update</v11:ChangeType><v12:DataGroup>address</v12:DataGroup></v11:ChangeSummary>  <Address>      <v13:EntityId>        <v13:EntityTypes>          <v13:EntityType>CDM.Address</v13:EntityType>        </v13:EntityTypes>        <v13:Identifiers>          <v13:Identifier>            <v14:EffectiveStartTime>2002-07-31T00:00:00.000+10:00</v14:EffectiveStartTime>            <v13:Qualifier>ADDRESSES</v13:Qualifier>            <v13:Value>69</v13:Value>            <v13:IdentifierType>CDM.Address.Id</v13:IdentifierType>          </v13:Identifier>        </v13:Identifiers>      </v13:EntityId>      <v16:AddressLine1>"Karoo"</v16:AddressLine1>      <v16:SiteName>"Karoo"</v16:SiteName>      <v16:StateCode>NSW</v16:StateCode>      <v16:Postcode>2642</v16:Postcode>      <v16:Suburb>JINGELLIC</v16:Suburb>      <v16:AddressTenancies>        <v16:AddressTenancy>          <v13:EntityId>            <v13:EntityTypes>              <v13:EntityType>CDM.AddressTenancy</v13:EntityType>            </v13:EntityTypes>            <v13:Identifiers>              <v13:Identifier>                <v14:EffectiveStartTime>2002-07-31T00:00:00.000+10:00</v14:EffectiveStartTime>                <v13:Qualifier>ENY_ADDRESSES</v13:Qualifier>                <v13:Value>71</v13:Value>                <v13:IdentifierType>CDM.AddressTenancy.Id</v13:IdentifierType>              </v13:Identifier>            </v13:Identifiers>          </v13:EntityId>          <v16:AddressReference>            <v13:EntityTypes>              <v13:EntityType>CDM.Address</v13:EntityType>            </v13:EntityTypes>            <v13:Identifiers>              <v13:Identifier>                <v14:EffectiveStartTime>2002-07-31T00:00:00.000+10:00</v14:EffectiveStartTime>                <v13:Qualifier>ADDRESSES</v13:Qualifier>                <v13:Value>69</v13:Value>                <v13:IdentifierType>CDM.Address.Id</v13:IdentifierType>              </v13:Identifier>            </v13:Identifiers>          </v16:AddressReference>          <v16:Tenant>            <v13:EntityTypes>              <v13:EntityType>CDM.Person</v13:EntityType>            </v13:EntityTypes>            <v13:Identifiers>              <v13:Identifier>                <v14:EffectiveStartTime>2002-07-31T00:00:00.000+10:00</v14:EffectiveStartTime>                <v13:Qualifier>ENY_ADDRESSES</v13:Qualifier>                <v13:Value>16951</v13:Value>                <v13:IdentifierType>CDM.Person.Id</v13:IdentifierType>              </v13:Identifier>            </v13:Identifiers>          </v16:Tenant>          <v16:Usage>Residential</v16:Usage>        </v16:AddressTenancy>      </v16:AddressTenancies>    </Address>  </AddressNotificationRequest></v1:notifyAddress></soap:Body></soap:Envelope>  There are another 8 xmls I need to do this for. This is the simplest one.
mean I have to change the prefix g to v13 when inserting it into the second xml.
 Though it would look cleaner, no, you don't have to do that.As I explained in your other thread, namespace prefixes don't matter provided the target URI is the same. So, you could very well do the following, and the resulting document would still be OK for the consumer :
select insertChildXML(
         xml_target
       , '/soap:Envelope/soap:Body/v1:notifyAddress/AddressNotificationRequest'
       , 'b:Address'
       , extract(
           xml_source
         , '/p:getEntitySummaryResponse/GetEntitySummaryResponse/b:Address'
         , 'xmlns:p="http://www.cars.ccc/Namespace/Integration/Notification/Services/Data/Entity/V1.0"
            xmlns:b="http://www.cars.ccc/Namespace/Address/Core/V1.0"'
         )
       , 'xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
          xmlns:v1="http://www.cars.ccc/Namespace/BS/AddressService/V1.0"
          xmlns:b="http://www.cars.ccc/Namespace/Address/Core/V1.0"'
       )
into xml_target
from dual;
 
The red part extracts the address node, the blue part inserts it in the envelope at the required position.
Thanks for that. I understand that the XML will still parse regardless of the namespace prefix but wouldn't the end system need to know the prefixes when extracting data from the xml just like this bit in the code above. A WSDL has already been given to the other parties with the prefixes defined. I wouldn't have thought they would be expecting those namespace prefixes. Going back to the namespaces added to the tags during the extraction, I guess I'd like to produce the extra format as indicated in the WSDL, as I'm not familiar with the code used to extract data from the XML (.Net) so want to avoid any potential issues.  xml_target       , '/soap:Envelope/soap:Body/v1:notifyAddress/AddressNotificationRequest'       , 'b:Address'       , extract(           xml_source         , '/p:getEntitySummaryResponse/GetEntitySummaryResponse/b:Address'
Ok, After some discussions internally it seems like my understanding of XML is insufficient and it is incorrect is mean to hard-code any namespace prefixes in any code at all, so I'll go with the SQL above.

Counting conditionally

Hi there,
I am using BI Publisher Desktop for MS Word and have a set of Activity rows (from a Siebel Integration Object generated XML file) that I want to count based on different conditions.
For example, I want to counts of each of the following:
1) the total number of Activities
2) the number of Activities that have specific Type and Outcome combinations (from a static list)
3) the number of Activities that have a flag set to True
4) the number of Activities for each of 5 or 6 different Types
Im ok with #1 :P but Im struggling with how to conditionally count in the other cases.....all of this needs to be on one report. Im an extreme newbie, and betting that there is a straightforward answer that Im too brain-fried to see.
Thanks! 
This can be done within the RTF template as long as the XML data has the fields that you want to conditionally count on. Provide your XML data sample.
Pleae check out the following: Count and sum based on grouping(could be related to crosstab) It will give you some good ideas.
Search the forum for more examples..
Hope this helps. Thanks! 
I am going to take a closer look at the link you sent to me, but in the meantime here is my sample xml:
So I would want to count the number of Activities (by ActivityId) for the following scenarios....
Total Activities (all of Activities in the resultset)
Number of Activities with Specific Activity Types (ie number with Type = "Email")
Number of Activities where the XRXNewContact field = "New"
Number of Activities that have Type and Outcome combinations that are in a criteria list
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
- <ListOfBip-ActivitiesList-Xrx>
- <Action>
<ActivityId>0V-I0CE5</ActivityId>
<OwnerFirstName>John</OwnerFirstName>
<OwnerLastName>Smith</OwnerLastName>
<PrimaryOwnedBy>CAN123</PrimaryOwnedBy>
<Status>Done</Status>
<LastUpdated>03/31/2010 13:25:19</LastUpdated>
<XRXManagerEmployeeId>045667</XRXManagerEmployeeId>
<XRXManagerFirstName>Kate</XRXManagerFirstName>
<XRXManagerLastName>Jackson</XRXManagerLastName>
<XRXNewContact>Old</XRXNewContact>
<XRXOutcome>Inbound</XRXOutcome>
<XRXType>Email</XRXType>
</Action>
- <Action>
<ActivityId>0V-1D8ZC7</ActivityId>
<OwnerFirstName>John</OwnerFirstName>
<OwnerLastName>Smith</OwnerLastName>
<PrimaryOwnedBy>CAN123</PrimaryOwnedBy>
<Status>Done</Status>
<LastUpdated>03/31/2010 12:20:10</LastUpdated>
<XRXManagerEmployeeId>045667</XRXManagerEmployeeId>
<XRXManagerFirstName>Kate</XRXManagerFirstName>
<XRXManagerLastName>Jackson</XRXManagerLastName>
<XRXNewContact>New</XRXNewContact>
<XRXOutcome>Inbound</XRXOutcome>
<XRXType>Email</XRXType>
</Action>
- <Action>
<ActivityId>0V-I4CE5</ActivityId>
<OwnerFirstName>John</OwnerFirstName>
<OwnerLastName>Smith</OwnerLastName>
<PrimaryOwnedBy>CAN123</PrimaryOwnedBy>
<Status>Done</Status>
<LastUpdated>03/31/2010 18:45:01</LastUpdated>
<XRXManagerEmployeeId>045667</XRXManagerEmployeeId>
<XRXManagerFirstName>Kate</XRXManagerFirstName>
<XRXManagerLastName>Jackson</XRXManagerLastName>
<XRXNewContact>Old</XRXNewContact>
<XRXOutcome />
<XRXType>Virtual Demo</XRXType>
</Action>
- <Action>
<ActivityId>0V-1D1ZC7</ActivityId>
<OwnerFirstName>John</OwnerFirstName>
<OwnerLastName>Smith</OwnerLastName>
<PrimaryOwnedBy>CAN123</PrimaryOwnedBy>
<Status>Done</Status>
<LastUpdated>03/31/2010 01:20:10</LastUpdated>
<XRXManagerEmployeeId>045667</XRXManagerEmployeeId>
<XRXManagerFirstName>Kate</XRXManagerFirstName>
<XRXManagerLastName>Jackson</XRXManagerLastName>
<XRXNewContact>New</XRXNewContact>
<XRXOutcome>Interest Expressed</XRXOutcome>
<XRXType>Inbound Call</XRXType>
</Action>
- <Action>
<ActivityId>0V-1D2ZC7</ActivityId>
<OwnerFirstName>John</OwnerFirstName>
<OwnerLastName>Smith</OwnerLastName>
<PrimaryOwnedBy>CAN123</PrimaryOwnedBy>
<Status>Done</Status>
<LastUpdated>03/31/2010 10:01:45</LastUpdated>
<XRXManagerEmployeeId>045667</XRXManagerEmployeeId>
<XRXManagerFirstName>Kate</XRXManagerFirstName>
<XRXManagerLastName>Jackson</XRXManagerLastName>
<XRXNewContact>Old</XRXNewContact>
<XRXOutcome>No Answer</XRXOutcome>
<XRXType>Outbound Call</XRXType>
</Action>
- <Action>
<ActivityId>0V-I3CE5</ActivityId>
<OwnerFirstName>John</OwnerFirstName>
<OwnerLastName>Smith</OwnerLastName>
<PrimaryOwnedBy>CAN123</PrimaryOwnedBy>
<Status>Not Started</Status>
<LastUpdated>03/31/2010 18:32:12</LastUpdated>
<XRXManagerEmployeeId>045667</XRXManagerEmployeeId>
<XRXManagerFirstName>Kate</XRXManagerFirstName>
<XRXManagerLastName>Jackson</XRXManagerLastName>
<XRXNewContact>Old</XRXNewContact>
<XRXOutcome />
<XRXType>Outbound Call</XRXType>
</Action>
</ListOfBip-ActivitiesList-Xrx> 
<?count(ActivityId)?>
<?count(/ListOfBip-ActivitiesList-Xrx/Action[./XRXType=’Email’]/ActivityId)?>
<?count(/ListOfBip-ActivitiesList-Xrx/Action[./XRXNewContact =’New’]/ActivityId)?>
I didnt get your 4th requirement 
For the 4th one I have a list of about 30 Activity Type / Outcome Combinations which to us mean that our reps have had a meaningful discussion with the customer - we call them Pmetric Contacts. So, a Pmetric Contact can have one of the following Activity Type > Outcome Combinations (I'm just going to list a few for the sake of the post):
Type = "Inbound Call" and Outcome in("Interest Expressed", "Information Gathered", "Proposal Sent")
OR
Type = "Email" and Outcome in("Inbound", "Outbound", "Web")
OR
Type = "Outbound Call" and Outcome in ("Interest Expressed", "Information Gathered", "Wrong Contact", "Proposal Sent")
Thanks for your reply! I will give that a go :) 
add your conditions in this way..
<?count(/ListOfBip-ActivitiesList-Xrx/Action[(./XRXOutcome=’Inbound’ and XRXType=’Email’) or (./XRXOutcome=’Interest Expressed’ and XRXType=’Inbound Call’)]/ActivityId)?> 
That information was perfect! Thank you!

editing processor sql without visualizer

Hi,
Is there a way to change processor query without using Oracle CEP visualizer? For example, EPN assembly file has a piece of code :
     <wlevs:processor id="myProcessor" queryURL="??"/>If I set the queryURL attributes, it is read only once or at specified interval? How can i do dynamic a processor component without CEP Visualizer?
Thanks. 
Yes, you can use command line to do it:
java -jar $BEA_HOME/bin/wlevsadmin.jar -url service:jmx:msarmi://localhost:9002/jndi/jmxconnector -username wlevs -password wlevs ADDRULE -application applicationName -processor processorName -rule ruleName "select * from..."
Please refer to the CEP documents for more detail.
Thanks
Junger 
Thanks a lot Junger,
I have an another question. I could change existing cql query via your direction. That's ok.
But, there is an another question. For example, assume that, there are only one processor. And only one outputBean. Does outputBean class understand query name of incoming events? Because there is only one processor and one outputBean. And processor has a number of queries and results of all of queries are sent to same outputBean. So, outputBean should understand query name of incoming events.
How can i learn query name in outputBean? Thanks. 
you can use <selector> to partition the events to different user beans, the configuration should be like:
--spring configuration
<wlevs:processor id="myProcessor">
<wlevs:listener ref="outChannel1"/>
<wlevs:listener ref="outChannel2"/>
<wlevs:listener ref="outChannel3"/>
</wlevs;processor>
<wlevs:channel id="outChannel1">
<wlevs:listener ref="outBean1"/>
</wlevs:channel>
...
--wlevs configuration
<processor>
<name>myProcessor</name>
<rules><rule id="query1">...</rule><rule id="query2"></rule><rule id="query3">...</rule></rules>
</processor>
<channel>
<name>outChannel1</name>
<selector>query1</selector>
</channel>
... 
I've already know this. But, i wonder, should i define different user output bean ? Because my number of queries is not known, is not fixed. To your expression, i should define a bean for each query. Is there any tip to get name of query in outputBean?
Thanks. 
For example, can i define a cql query like this :
query1 = select 'QUERY1' as queryname,T.* FROM INPUTCHANNEL T WHERE event.a = 15
query2 = select 'QUERY2' as queryname,T.* FROM INPUTCHANNEL T WHERE event.b = 30
If i define this, I can access this queryname in outputbean.
Another solution,
In cql query, can i call a setter function of event like "event.queryname = 'query1'" I can access this field with getter method in outputBean.
Thanks. 
Could you tell me why you want to get the query name? In fact if you want to do, you always have a way to do it. But I don't think it's meaningful or at least it's not a good practice.
We support complex type(object type and nested property) in ps2 with the new feature java cartridge. But the usage is different than you gussed. Please refer to the CEP 11gR1 PS2 documents for details.
Thanks
Junger

Fatal Error using node-level indices (bdbxml 6.0.xx)

I've discovered a bug in dbxml 6 -- first seen in 6.0.17 and still seems to exist in 6.0.18.   Loading four documents (1.xml, 2.xml,3.xml,4.xml) of the following structure (truncated) into a node-level indexed container named Detections: <?xml version="1.0" encoding="UTF-8"?><Detections>    <DataSource>omitted</DataSource>    <Algorithm>omitted</Algorithm>    <UserID>buggy</UserID>    <Effort>omitted</Effort>    <OnEffort>        <Detection>            <Input_file>1HAT03A_DL34_130604_080615.df20.x.wav</Input_file>            <Start>2000-01-01T00:00:00Z</Start>            <End>2000-01-01T00:01:02Z</End>            <Event>01/13/11 12:00:00</Event>            <SpeciesID>180092</SpeciesID>            <Call>Active Sonar</Call>            <Parameters>                <Subtype>subtype</Subtype>                <UserDefined>                    <Peak_Hz>1111</Peak_Hz>                </UserDefined>            </Parameters>        </Detection>       <!-- many more Detections elements -->   </OnEffort></Detections>  and subsequently running the xquery:'let $detections := for $item in (    for $det in collection("Detections")/Detections  return    for $detection in $det/OnEffort/Detection    where $detection/Parameters/Subtype = "Echosounder"    return  1  )  return $itemreturn $detections' results in a crash either via dbxml.exe if using the shell, python.exe if done in Python or in the Java VM with an EXCEPTION_ACCESS_VIOLATION message. It occurs with an index on the specific element name "Subtype" in my example.e.g.//JavacontainerConf.setIndexNodes(XmlContainerConfig.On);...container.addIndex("","Subtype","node-element-equality-string"); #Pythoncont.addIndex('','Call','node-element-equality-string',upd_contxt)  If I turn indexing off, or use Wholedocument indices, or add indices to more shallow elements instead(e.g. Call, UserID), there is no crash. Seems to only occur on Subtype. This depends on the order in which the documents are added to the container. It crashes on the second document loaded containing /Parameters/Subtype, for example2.xml contains <Subtype>Echosounder</Subtype> and 1.xml contains <Subtype>Broadband</Subtype>. 3 and 4.xml do not contain Subtype elements.  If 2 is loaded into the container before 1, then the crash will occur where $var/Parameters/Subtype = "Broadband", rather than Echosounder.  It also requires a certain amount of data to be stored in the container -- when I make these files a bit smaller, the query executes fine.Originally two of the XMLs were quite large, ~9.5MB each. I trimmed them down considerably, and if I go further, the dbxml does not seem to crash. They are currently 542kb, 12kb, 363kb and 411kb respectively. I can post the four files here via google drive, or I can e-mail them.Please let me know if you can look into this. Thank you,Sean

Concurrency issues in JAX-WS for methods with #WebMethod(exclude=true)

Hi All, I am using JDeveloper 11.1.1.7.0 and Weblogic 10.3. I have created a working web service using SOAP. In the service, my web method is actually creating a PDF file with 'n' pages. I have created another method splitFiles with #WebMethod(exclude=true) which will break down the 'n' page document into 'n' documents. I have made the call to splitFiles from my web method. Up till this, it is working.The problem comes when i am firing multiple requests concurrently to the service from a web proxy I created. The web method is supporting parallel execution, but the execution becomes sequential when the process enters splitFiles  method. As a result of this, my entire service does not support concurrent requests. What could be the reason for this sequential execution? Is it because1) I am doing file operations in this method? 2) Non Web Methods do not support concurrency?Please let know the possible reasons for this issue. Thanks in advance.
Hi Harsha, I suggest you print the currently executing thread name in your methods and see whether the splitFiles is actually spawing to multiple thread requests for concurrent requests. I suggest use the below statement in both the Webmethods and check the message traces. System.out.println(Thread.currentThread().getName()); I think the issue could be to do with the file names and these should be unique for ex: PDFFileName1-Page1 , PDFFileName1-Page2 ..... ; PDFFileName2-Page1 , PDFFileName2-Page2 ...... .  The execution would be sequential in the splitFiles but for the currently executed Thread and believe you do the merge of all the split pages again in your webmethod. Hope it helps.
957742 - I have added my logs and have found out that when a thread is actually executing splitFiles method, all the other threads are waiting.  Thread.currentThread().getName() are giving correct names for the respective threads.  After the split, the filenames are unique. Any other possible reasons?
I hope all threads write to different files.Is the method declared with synchronization or portion of code is synchronized?.Inside Splitfiles, reference to object which writes to files  is a local variable or you are accessing a class level variable?. 
Hi Harsha, The below links talks about '#ThreadScope' annotation. You could try looking into the same and yes as already mentioned earlier hope you are not using synchronized methods within your code. https://jax-ws-commons.java.net/thread-scop  http://javaeenotes.blogspot.co.uk/2011/03/thread-scoped-jax-ws-webservices.html http://discipline.elcom.pub.ro/soa/jp/webservices/jaxwsglassfish.pdf  ( Pages 77, 78 ) 
Krishna Hanumantharao and 957742  - Sorry for my late reply. I have been analyzing my code and I have a clarification after my initial analysis. In my webmethod i am using Hashtable. Can this be the reason which is making my web service execution sequential? Hashtable's put and get methods are synchronized. Should i convert all Hashtable objects to ConcurrentHashMap ? Is there any other alternative?
ConcurrentHashMap also will have a lock, but not at the object level. Certainly will improve performance compared to Hashtable.However, do you really need to synchronize?. Does multiple thread access same data and modify?. If not you could just use HashMap.Did you try  annotating WebMethod with #ThreadScope to avoid synchronization issue?.  EveryThread will get a copy of Hashtable  and there won't be any wait period.
Hi Harsha, The concurrentHashMap more or less uses the same locking mechanism for HashMap and Synchronized Map but it is designed for concurrent use and use the concept of segments and locking would be done on segments instead of the whole HashMaps. Your issue here is though the Resource contention on the 'splitFiles' method. I would suggest rather than calling the splitFiles method, have the same logic within your Webmethod ( Also use #ThreadScope ) and check to see if parallel execution is happening.  If it works then you could look into how you could modularize the code later. Hope it helps.
957742 Will try that... but we will face this problem with Hashtable isnt it? 
Krishna Hanumantharao - I added #ThreadScope to my Service class and it did not help me. Below mentioned are the sequence of operations in the service. 1) 15 Threads are accessing the service at the same time.2) Each thread creates a pdf document (say each document has 500 pages) in different locations. So it creates 15 documents with 500 pages each.Note: This creation of pdf involves database transactions. All the streams and connection objects are closed appropriately.3) Now this file created on the server will be copied to a user defined location to split the files. Every document of 500 pages should be made into 500 documents. So will be creating 7500 documents.4) splitFiles method is doing the below operationswill execute some sql queries to get required info.the PdfReader API of iText Library will read the main document to get the 'n' number of pages in the document.Loops through 'n' times where each page is read and written as a new file with a unique file name into the user defined location(unique for each thread). Currently if one thread takes 40 seconds to complete serving a request. 3 threads are taking close to 120 seconds(this is making it appear to run sequentially)Do these many file operations make it time consuming? I do not want to synchronize because i want all the execution to run parallel. 957742 - Any thoughts?
If you haven't done this already, can you do this and checkPrint  Thread Name & Time (till millisecond) inEntry & Exit of Web Method functionEntry & Exit of splitFiles function.Before and After calling DB functionsBefore and After calling File Write functions. What tool you are using to create 15 threads?.You can also check whether your DB connection pool has necessary number of connections.
I have written a web proxy client program. For UI i have created an ADF Application to send the request parameters. This is purely for testing purposes. In the proxy i have used the below code to allow concurrency. 
private static final int MYTHREADS = 15;
ExecutorService executor = Executors.newFixedThreadPool(MYTHREADS);
for (int i = 0; i < printRequestIDList.size(); i++) {
   String requestID = printRequestIDList.get(i) + "";
   String fileLocation = printFileLocationList.get(i) + "";
   Runnable worker =
       new MyRunnable(requestID, requestedBy, printTo, fileFormat, fileLocation, fileNameFormat);
    executor.execute(worker);
}
 in the run() method, below code is used to send requests. 
printService = new PrintService();
SecurityPoliciesFeature securityFeatures =
    new SecurityPoliciesFeature(new String[] { "oracle/wss_username_token_client_policy" });
PrintPort printPort = printService.getPrintBinding(securityFeatures);
((BindingProvider)printPort).getRequestContext().put(BindingProvider.USERNAME_PROPERTY,"username");
((BindingProvider)printPort).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,"password");
PrintRequest printRequest = new PrintRequest();
printRequest.setRequestId(requestID);
printRequest.setRequestBy(requestedBy);
/*
* Set all parameters here
*/
printLabelsRequest.setFileLocation(fileLocation);
PrintResponse printResponse = printPort.printOper(printRequest);
Will update the other details soon u asked for soon.
Now I made a note of another point. After adding the timings on the the proxy to calculate the time from sending the request to receiving response, the timings are doubling in case of 2 threads.The service is entirely empty now. If a single thread returns in 0.4 seconds, then two threads are taking 0.8 seconds.  Does this mean that the service itself is not executing parallely? Or is there something wrong in my proxy code(see above post). I have added #ThreadScope to my WebMethod. Krishna Hanumantharao957742 - Please help me in this regard.
Hi Harsha, This behaviour is dependent on the container on which you deploy your web service to. Weblogic container executes the JAX WS life cycle similar to a servlet life cycle wherein you have only one instance of the service at one point of time. I suggest you create a Work Manager (A ThreadPool with Min Max Threads ) in your Weblogic console for your application. There are lot of articles available online as of how to create Work Manager from Weblogic Admin Console.  Target the work manager to the server on which you are  deploying your JAX WS webservice. Now in your JAX WS webservice ( don't know how you are wrapping your service : Ex as a WAR file or EAR file ) create deployment descriptors ( ex: weblogic-application.xml , weblogic.xml , weblogic-web.xml ) based on how you are wrapping your web service ( WAR/EAR ) and within this deployment descriptor file associate the Work Manager you have created earlier for your application. The below links will be useful to you. http://stackoverflow.com/questions/8839166/weblogic-workmanagers-and-jax-ws-webserviceshttps://docs.oracle.com/cd/E11035_01/wls100/config_wls/self_tuned.htmlhttp://middlewaremagic.com/weblogic/?p=385https://www.youtube.com/watch?v=NnRcM29zJb4 Or else you could use the below link for creating " Application Scoped Work Managers ".  You just deploy the existing version of your code and follow the below link. Administration Console Online Help Hope it works for you.
957742  i have created Application Scoped Work Manager. I am not seeing any change in the time taken. Please tell me if what i have done is correct. In my weblogic.xml i have the below. 
<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"
                  xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
  <work-manager>
      <name>WorkManagerA</name>
      <fair-share-request-class>
        <name>high_priority</name>
        <fair-share>1000</fair-share>
      </fair-share-request-class>
      <min-threads-constraint>
        <name>MinThreadsCountOne</name>
        <count>1</count>
      </min-threads-constraint>
      <max-threads-constraint>
        <name>MyMaxThreadCountThirty</name>
        <count>30</count>
      </max-threads-constraint>
  </work-manager>
  <wl-dispatch-policy>WorkManagerA</wl-dispatch-policy>
</weblogic-web-app>
 and in my web.xml 
<?xml version = '1.0' encoding = 'UTF-8'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
  <servlet>
    <servlet-name>PrintBinding</servlet-name>
    <servlet-class>com.cc.ns.cc.v1.PrintPortImpl</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>PrintBinding</servlet-name>
    <url-pattern>/PrintBinding</url-pattern>
  </servlet-mapping>
  <resource-ref>
    <res-ref-name>WorkManagerA</res-ref-name>
    <res-type>commonj.work.WorkManager</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
  </resource-ref>
</web-app>

Categories

Resources