1. Home
  2. Knowledge Base
  3. SureMDM
  4. Android Management
  5. How to stop job execution within composite and casual jobs when an error is encountered on Android devices

How to stop job execution within composite and casual jobs when an error is encountered on Android devices

When there is a dependency on each of the commands or jobs that are created to be deployed on Android devices, such as an install job or a runscript job, along with combinations of other jobs, and if the first dependent job fails in a subsequent listed job, there’s a feature in SureMDM that provides an option to stop the execution of the subsequent jobs that are in sequence. 

Administrators can now have the option to enable “Stop Job Deployment On Error” in composite and casual jobs. So, with this feature, if any job that is supposed to execute at first encounters an error, it will skip the subsequent jobs in the sequence.

Purpose

The purpose of this knowledge article is to provide a guide on how to stop the execution of subsequent jobs within composite jobs and casual jobs when any job that is supposed to execute at first encounters an error on the Android devices.

Prerequisites

  • Supported by SureMDM Agent v27.31.01 onwards.
  • There are no restrictions on the type of enrollment or device.

Steps

  1. Log in to the SureMDM console.
  2. Navigate to the Jobs Tab.
  3. Navigate to Android and select the Composite or Casual job (based on the requirement).

4. Check Stop Job Deployment On Error to enable the option once the required jobs are added in sequence.

5. You will get a prompt that says, Enabling this option will stop the subsequent sub-jobs from being run if the previous sub-job fails. Are you sure you want to enable it? , Click Yes and Save the job.

6. Go to SureMDM Home and select the device(s).

7. Click on Apply, select the job created, and Apply to the device. 

Below are a few example test cases showing the Composite job or Causal job status on the device with and without enabling the option Stop Job.

Deployment on Error:

  • When the Composite Job is deployed to the device by enabling “Stop Job Deployment On Error” 

We can see below as an example where the subsequent jobs are in error, as the prior job went to error.

  • When the Composite Job is deployed to the device by disabling “Stop Job Deployment On Error” 

We can see that the subsequent jobs were successfully deployed, even when there was an error in the prior job’s deployment.

Need help? CONTACT US 

Was this helpful?
YesNo
Updated on March 2024