FlowPDF::StepParameters

1 minute readReferenceExtensibilityDeveloper productivity

This class provides methods to process current step parameters, that are either defined in a procedure step or a pipeline task.

To initialize a FlowPDF::StepParameters object you need to use the getStepParameters() method from FlowPDF::Context.

isParameterExists($parameterName)

Returns true if parameter exists in the current step.

Parameters

(String) Name of parameter

Returns

(Boolean) True if parameter exists.

Usage

if ($stepParameters->isParameterExists('query')) { ...; }

getParameter($parameterName)

Returns either a FlowPDF::Parameter object or FlowPDF::Credential object.

Parameters

(String) Name of parameter to get.

Returns

One of the following

  • FlowPDF::Parameter

  • FlowPDF::Credential

Usage

my $query = $stepParameters->getParameter('query');

If your parameter is of type FlowPDF::Parameter, you can get its value either by getValue() method, or using string context:

print "Query:", $query->getValue();

Or:

print "Query: $query"

If your parameter is FlowPDF::Credential follow its own documentation.

getRequiredParameter($parameterName)

Returns a FlowPDF::Parameter object or a FlowPDF::Credential object if parameter exists.

If parameter does not exist, this method aborts execution with exit code 1.

This exception cannot be caught.

Parameters

(String) Name of parameter

Returns

One of - FlowPDF::Parameter - FlowPDF::Credential

Usage

To retrieve parameter object:

my $query = $stepParameters->getRequiredParameter('query');

If your parameter is of type FlowPDF::Parameter you can retrieve its value either by getValue() method, or using string context:

print "Query:", $query->getValue();

Or:

print "Query: $query"

If your parameter is of type FlowPDF::Credential refer to its documentation.

asHashref()

Description

This function returns a HASH reference that is made from FlowPDF::StepParameters object. Where key is a name of parameter and value is a value of parameter. For credentials the same pattern as for getRuntimeParameters from FlowPDF::Context is being followed.

Parameters

None

Returns

(HASH reference) A HASH reference to a HASH with step parameters.

Exceptions

None

Usage

my $stepParameters = $context->getStepParameters()->asHashref(); logInfo("Application path is: $stepParameters->{applicationPath}");