← Prev in month ← Prev in thread
Next in thread → Next in month →

a shot at upgrading Find operation

From
Durand, Jacques R. <>
Date
2008-04-16T02:56:47+00:00
ID
Thread
a shot at upgrading Find operation
Here is what an upgrade to the 
"find" operation - considered a requirement in the F2F - could look 
like.

The operation 
can select a combination of events, possibly correlated based on content, 
possibly partially or totally ordered in time.

The name 
"Find" has been replaced by "Catch" to better reflect the synchronization aspect 
(not just the search aspect, in deferred mode).

The design 
outlined below borrows a lot from existing eTSL draft, but takes into account 
the ease of implementation with XSLT, for an easy baseline implementation 
:-)

 

Jacques

Catch( <tryDuration>? <input>? <selector> <view>? 
)

Select one or more 
non-masked events from the event board within a time window. The selection is 
based on conditions expressed with external script languages, 
e.g. XPath or Xquery. The operation may wait for the event(s), acting as 
a synchronizing control. 

To be eligible for 
selection by this operation, an event of the event board must satisfy the 
following conditions:

  

  
the event is not 
  masked for the monitor instance executing 
  “find”,

  

  
the 
  event posting time (dateTime) is in the window [visibilityDate, 
  time-cursor]

  

  
In case 
  it is a temporary event, it is associated with the same CES as this monitor 
  instance (it has been posted by a monitor instance from the same test case 
  execution).

  

  
The event is within scope (if any, defined by 
  <scope> argument)

Only such events 
will be considered for selection. Selected events will be part 
of the result set for the operation.

The 
operation invocation can take two forms. (NOTE: the syntax reuses some XSLT 
syntax)

In the 
first form below (called here “referring form”), it refers to a “catcher” 
definition provided elsewhere, and identified by the attribute @catcher. Values 
can be given to parameters of the catcher definition. An optional <input> 
element defines the set of events to be used as input to the 
selection.

<catch tryduration=[xsd:duration] 
catcher=”catchername”>

<xsl:with-param 
name="myparam1" select="...."/>

<xsl:with-param 
name="myparam2">...</xsl:with-param>

... (other 
parameters)

<input>...</input>

</catch>

In the “inline form”, the same selection elements that 
would be provided in a “catcher” definition (except for parameters), are 
provided inline, as shown in the following example:

<catch tryduration=[xsd:duration] 
>

<xsl:var name="V1"/>

<match name="E1" 
starting="initialDate">...</match>

<match name="E2" starting="initialDate" 
after=”E1”>...</match>

<input>...</input>

</catch>

The 
<match> element will select one event based on a conditional expression 
specified in the <condition> child element. When a combination of two or 
more events needs be selected possibly based on different conditional 
expressions, each event will be named (here “E1” and “E2”), and an order 
(possibly partial) may be specified between these using the attribute @after. 
The <match> element may also include the setting of some variable with 
event data, to be reused in the selection expression of another <match> 
expression, allowing correlation between selected events based on their 
content.

The 
following is a more complete example of a “catcher” definition, that selects a 
sequence of three events representing an exchange of three messages: 

  

  
(E1) a 
  purchase order request,

  

  
(E2) 
  a PO response (acceptance or 
  rejection), 

  

  
(E3) a 
  receipt to the PO response

The 
correlation between these events relies on variables V1 and 
V2.

<tam:catcher name="myevents">

  <xsl:param 
name="P1"/>

  <xsl:var 
name="V1"/>

  <xsl:var 
name="V2"/>

  <tam:match 
name="E1">

    
<tam:condition language="xpath">[content/soap/Header/msgData/action 
= "PORequest"]</tam:condition>

    <tam:set 
var="V1">

      
<xsl:value-of 
select="./content/soap/Header/msgData/property[@name='productref']"/>

    
</tam:set>

  
</tam:match>

  <tam:match name="E2" 
after="E1">

    
<tam:condition 
language="xpath">[(content/soap/Header/msgData/action = "POAccept" or 
content/soap/Header/msgData/action = "POReject") and 
content/soap/Header/msgData/property[@name='productref'] = 
$V1]</tam:condition>

    <tam:set 
var="V2">

      
<xsl:value-of 
select="./content/soap/Header/msgData/messageID"/>

    
</tam:set>

  
</tam:match>

  <tam:match name="E3" 
after="E2">

    
<tam:condition language="xpath">[content/soap/Header/msgData/action 
= "POResponseReceipt" and content/soap/Header/msgData/messageID = 
$V2]</tam:condition>

  
</tam:match>

<!-- eventset> a regular expression (E1, E2) </eventset 
-->

</tam:catcher>
← Prev in month ← Prev in thread
Next in thread → Next in month →