Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
var results = $XmlRepository.QueryXml('collection("49551ed3-6229-408a-aaaa-eb510463acad")//Customer[Id=$id]', {
id : $Xml.Evaluate('CustomerId')
});
$Xml.InnerXml( 'Customers', results[0].Evaluate('Id') );

Remarks

If query does not return any result than return value is empty array.

The examples below shows how to query the domain database.

Example

Find all customers

Code Block
languagejs
var results = $XmlRepository.Query('//Customer');
$Xml.InnerXml( 'Customer', results.join() );

Example

Find customer by id

Code Block
languagejs
var results = $XmlRepository.Query('//Customer[Id=$id]', {
   id : $Xml.Evaluate('CustomerId')
 });
$Xml.InnerXml( 'Customers', results.join() );

Example

Querying process database

Code Block
languagejs
var results = $XmlRepository.QueryXml('collection("49551ed3-6229-408a-aaaa-eb510463acad")//Customer[Id=$id]', {
id : $Xml.Evaluate('CustomerId')
});
$Xml.InnerXml( 'Customers', results[0].Evaluate('Id') );

Examples

...

Code Block
languagejs
var results = $XmlRepository.Query('//Customer');
$Xml.InnerXml( 'Customer', results.join() );

...

Code Block
languagejs
var results = $XmlRepository.Query('//Customer[Id=$id]', {
   id : $Xml.Evaluate('CustomerId')
 });
$Xml.InnerXml( 'Customers', results.join() );

...

Code Block
languagejs
var results = $XmlRepository.QueryXml('collection("49551ed3-6229-408a-aaaa-eb510463acad")//Customer[Id=$id]', {
id : $Xml.Evaluate('CustomerId')
});
$Xml.InnerXml( 'Customers', results[0].Evaluate('Id') );