Jump to content
JasperReports Library 7.0 is now available ×

php client simple trigger problem


Recommended Posts

Hi All,

I am using the latest jrs php client. On selecting the following option:

Run until a specified date:

And entering the simpleEndDate

I am writing the following code :

                    $trigger = new SimpleTrigger();
                    $trigger->startType = $scheduleTrigger['startType'];
                    if ($scheduleTrigger['startType'] == 2) {
                        $trigger->startDate = $scheduleTrigger['startDate'];

                    $trigger->recurrenceInterval = $scheduleTrigger['interval'];
                    $trigger->recurrenceIntervalUnit = $scheduleTrigger['intervalUnit'];
                    if (!empty($scheduleTrigger['occurrenceCount'])) {
                        $trigger->occurrenceCount = $scheduleTrigger['occurrenceCount'];
                    if (!empty($scheduleTrigger['endDate'])) {
                        $trigger->endDate = $scheduleTrigger['endDate'];

Note, that I am not setting

$trigger->occurrenceCount, when setting the trigger endDate. But it returns an unknown http status code and does not create a job. After adding the following line:

                    if (!empty($scheduleTrigger['endDate'])) {
                        $trigger->occurrenceCount = 1;
                        $trigger->endDate = $scheduleTrigger['endDate'];

It creates a job successfully. But I think it is not intended to work like that. Could anyone let me know if I am missing something when using Schedule end date for simple trigger ?



Link to comment
Share on other sites

  • 3 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...