Resume a Shoot

This section explains how to resume a shoot for a vehicle, regardless of whether the previous shoot was in Draft, Completed, or Failed. The spyne.startShoot() function handles all scenarios, with the SDK automatically deciding whether to continue, resume, or start a new shoot.


1. Vehicle Matching Logic

The SDK uses the following vehicle identifiers to determine whether to resume, continue, or start a new shoot:

  • vin (Vehicle Identification Number)
  • stockNumber
  • registrationNumber

If any of these match an existing vehicle, the SDK will resume the shoot or start a reshoot based on the vehicle’s previous state.

If no match is found, a new shoot will be created.


2. Resume a Shoot (Draft, Completed, or Failed)

You only need to call the startShoot() function. The SDK will handle:

  • New Shoot: If no matching vehicle is found.
  • Resume Draft: If the vehicle has an unfinished shoot.
  • Reshoot: If the previous shoot was completed or failed.
val builder = SpyneAutomobileSDK.Builder(context = this, listener)
    .setEnvironment(ShootEnvironment.Production)
    .setUserData(
        UserData(
            userId = "<email id of the user/user id as per your system>"
        )
    )
    .setShootData(
        ShootData(
          	// Provide at least one of the vehicle identifiers (vin, stockNumber, or registrationNumber)
						vin = "<Vehicle identification Number>", //Should be 17 digit alphanumeric
            stockNumber = "<Stock Number of vehicle as per your system>",
            registrationNumber = "<Vehicle Registration Number>"
        )
    )
    .setLocale("en") // language code
val spyne = builder.build()
spyne.startShoot()

Key Points:

  • One function (startShoot()) handles starting, resuming, or restarting the shoot.
  • The SDK checks the vehicle’s existing data and automatically determines the appropriate action.
  • You do not need to specify the shoot state (Draft, Completed, Failed).

3. Key Considerations

  • Vehicle Matching: The SDK uses any of the identifiers (vin, stockNumber, registrationNumber) to match the vehicle.
  • Automatic State Handling: You don’t need to pass the shoot state; the SDK resolves it internally.

Note: If identifiers like vin1 and stock1 are reused, the SDK will continue the first shoot.


4. Error Handling

  • Mismatched Identifiers: If you change the identifiers (vin, stockNumber, registrationNumber), the SDK will treat it as a new shoot.
  • Invalid Data: Ensure that the vin is 17 characters long and properly formatted to avoid errors.