Please enable JavaScript to view this site.

The manual for the JobRouter developer

Navigation: System activities > System activity execution logic

Execute the chosen function in the simulator

Scroll Prev Top Next More

Basic functionality

You first chose a function when you configured the system activity through the interface. In the XML configuration this function has a unique identification (through the functionId). The complete execution logic can now be implemented within one basic class, which has the same name as the chosen functionId. Naturally you can also define helper methods and properties, which are called up within this method or which are used by the API for system activities. But more on that later.

Example

The following example shows the extended source code of the basic class with a first implementation of the functionId exportCsv. It throws an exception and cancels the execution of the system activity with an appropriate error message:

Implemented execution logic in the basic class (getDialogXml shortened for space reasons)

<?php

class csvSystemActivity extends AbstractSystemActivityAPI

{

    public function getActivityName()

    {

        return CONST_SA_CSV_NAME;

    }

 

    public function getActivityDescription()

    {

        return CONST_SA_CSV_DESCRIPTION;

    }

 

    protected function getDialogXml()

    {

        return "...";

    }

 

    // functionId='exportCsv'

    protected function exportCsv()

    {

        throw new Exception('exportCsv was executed');

    }

}

When you now execute the system activity in the simulator, you will receive the appropriate (and in this case desired) error message:

DEVELO~1_img15

Now you can start to implement the execution logic. You should know the status model beforehand, which crucially influences the execution, and the basic functionality of the programming interface (API).