Please enable JavaScript to view this site.

The manual for the JobRouter developer

Navigation: System activities > Use of PHP API methods for the CSV export example

Use parameters

Scroll Prev Top Next More

During the configuration we entered the separator as input parameter for the export of the CSV file. Now we would like to determine this parameter in the implementation. To do so we use the method resolveInputParameter with the parameter id. We extend the program logic so the value is saved within a variable:

Basic class without function (shortened)

<?php

class csvSystemActivity extends AbstractSystemActivityAPI

{

...

    protected function exportCsv()

    {

        $fieldDelimiter = $this->resolveInputParameter('fieldDelimiter');

    }

}

To verify that the value was returned correctly, we need a function to display the contents of the variable. A possibility to do so is the throwing of an exception containing the contents of the variable as message. This would work but at the same time this will stop the code execution and therefore further output is impossible. A more elegant solution by far is the debugging method of the API.