Java Code Examples for org.flowable.job.api.Job#getRetries()

The following examples show how to use org.flowable.job.api.Job#getRetries() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FailedJobRetryCmdTest.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
protected void waitForExecutedJobWithRetriesLeft(final int retriesLeft) {

        Job job = managementService.createJobQuery().singleResult();
        if (job == null) {
            job = managementService.createTimerJobQuery().singleResult();
            managementService.moveTimerToExecutableJob(job.getId());
        }

        try {
            managementService.executeJob(job.getId());
        } catch (Exception e) {
        }

        // update job
        job = managementService.createTimerJobQuery().singleResult();
        if (job == null) {
            job = managementService.createDeadLetterJobQuery().singleResult();
        }

        if (job.getRetries() > retriesLeft) {
            waitForExecutedJobWithRetriesLeft(retriesLeft);
        }
    }
 
Example 2
Source File: FailedJobRetryCmdTest.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
protected void waitForExecutedJobWithRetriesLeft(final int retriesLeft) {

        Job job = managementService.createJobQuery().singleResult();
        if (job == null) {
            job = managementService.createTimerJobQuery().singleResult();
            managementService.moveTimerToExecutableJob(job.getId());
        }

        try {
            managementService.executeJob(job.getId());
        } catch (Exception e) {
        }

        // update job
        job = managementService.createTimerJobQuery().singleResult();
        if (job == null) {
            job = managementService.createDeadLetterJobQuery().singleResult();
        }

        if (job.getRetries() > retriesLeft) {
            waitForExecutedJobWithRetriesLeft(retriesLeft);
        }
    }