X4 Help Center
7.5 7.4 German English
Auto Light Dark
Auto Light Dark
7.5 7.4 German English

Random Number Generator

This adapter creates random numbers based on the specified configuration.

Properties

Operation

Defines the operation executed by the adapter

Possible values:

  • Generate: generates an XML document with one or more random numbers

  • SetRandomNumbers: generates random numbers into an existing XML document via XPath

Parameters

min

Minimum value from which a random number is to be generated

Possible values: any positive number, e.g. 1

info Mustn't be negative or 0.

max

Maximum value from which a random number is to be generated

Possible values: any positive number, e.g. 100

info Mustn't be negative or 0.

count

Number of random numbers to be generated

Possible values: any positive number, e.g. 4

info Mustn't be negative or 0.

XPath

XPath to the desired XML element

info Only important for the operation setRandomNumbers.

Possible values: any XPath expression, e.g. Data/Example

elementName

Name of the XML element in which the random number is to be generated.

info Only important for the operation setRandomNumbers.

Possible values: Any name for an XML element, e.g. Id.

Status values

1

The adapter operation was executed successfully and the output contains an XML document with the random number(s)

-1

An error occurred during execution

  • Operations Generate and setRandomNumbers: the parameter count is less than 1

  • Operation setRandomNumbers: the input is no XML document

Input

The adapter expects an XML document as input for the operation SetRandomNumbers.

Output

Depending on the operation, the adapter outputs the following results:

  • Operation Generate: XML document with the generated random number(s)

  • Operation SetRandomNumbers: XML document with added random number(s)

Example
XML
<?xml version="1.0" encoding="UTF-8">
<Data>
  	<random>28</random>
  	<random>6</random>
	<random>10</random>
</Data>