Please enable JavaScript to view this site.

Process Designer

Navigation: PHP API > Parameter

Input parameter (getInputParameter)

Scroll Prev Top Next More

This function allows evaluating input parameters based on the name assigned in the configuration. The evaluation is done automatically based on the parameter type (Fixed value, process table or subtable) and can provide different return values or data types.

Parameter

Type

Description

$parameterName

string

The name assigned to the parameter in the configuration.

Possible return values:

Parameter type

Return type

Description

Text

string

-

Attachment

\SplFileInfo

PHP object of the type SplFileInfo, even if the files does not exist. The method isReadable() can be used to verify if a non-existent file is referenced. isReadable() überprüft werdenIf no attachment is available, null will be returned.

Integer

integer

-

Large integer

string

From a certain size on, large integers are no longer able to use the integer data type in PHP and will be returned as string. If the value is to be used for calculations, its type has to be explicitly manually converted (e.g. into float).

Decimal number (123.00)

float

-

Date

\DateTime

PHP object of the DateTime type. If no value is set, null will be returned.

JobArchive ID

string

The JobArchive ID is treated the sane as a large integer.

Subtables:

Please note, if the rule was linked to a subtable, the function returns an individual value for the current row, otherwise an array of values of all subtable rows using the rowId as key.

Error handling:

If a non-existent parameter is accessed, an exception will be thrown.

Example:

echo $this->getInputParameter("Supplier");

 

$invoiceFile = $this->getInputParameter("Invoice");

if ($invoiceFile && $invoiceFile->isReadable()) {

 echo $invoiceFile->getBasename();

}

 

$invoiceDate = $this->getInputParameter("InvoiceDate");

if ($invoiceDate) {

 echo $invoiceDate->format("d.m.Y");

}

 

try {

 echo $this->getInputParameter("NonExistant");

} catch (\Exception $e) {

 echo "Parameter does not exist.";

}