Salesforce Close Job

The Salesforce Close Job activity is used to close the open jobs that are created by using the plug-in or by using external REST API invocations. This activity is especially useful when closing Bulk Query jobs with PK Chunking.

General

Note: Do not use the Close Job activity in combination with Bulk Operation or Bulk Query without PK Chunking.

On the General tab, establish a connection with the Salesforce.com server.

The following table lists the configurations on the General tab of the Salesforce Close Job activity:

Field Module Property? Description
Name No The name displayed as the label of the activity in the process.
Salesforce Connection Yes The path to the Salesforce shared resource.

Click the Choose/Create Default Resource icon to browse and select a connection.

Description

On the Description tab, enter a short description for the Salesforce Close Job activity.

Input

On the Input tab, specify the input values for the Salesforce Close Job activity.

The following table lists the input elements on the Input tab of the Salesforce Close Job activity:

Input Items Data Type Description
CloseJobConnection (All fields in this section are optional.)
ServerUrl String Enter the web address of the endpoint that is used by this operation.
SessionId String Enter the unique ID associated with this session.
ExternalSessionIdUsed Boolean Specify whether an external session ID is used (true) or not (false).

If the value is set to true, an external session ID is automatically filled in the sessionId field.

Note: If the ExternalSessionIdUsed is set to true, the session cannot be refreshed and any attempt to do so results in an exception.
CloseJob
jobId String Enter the ID of the bulk job that is going to be closed or aborted.
state String Enter the state to update the job to.

Valid values: Closed or Aborted referring to either closing a job or aborting it.

CloseJobOptional
timeout Long Specify the number of milliseconds an internal API call waits before returning the data.

Default value: Infinite (that is, activity times out only after all records are processed)

Output

On the Output tab, you can find the output value.

The following table lists the output elements on the Output tab of the Salesforce Close Job activity:

Output Item Data Type Description
SalesforceCloseJobOutput
CloseJobResult jobId String Unique ID for this job as seen on Salesforce backend.
operation String The processing operation for all the batches in the job.

For example, update, create, delete, and so on.

object String The object type for the data being processed.
createdById String Salesforce ID of the use who created this job.
createdByDate String The date and time in the UTC time zone when the job was created.
systemModstamp String The date and time in the UTC time zone when the job was finished.
state String The current state of processing for the job.

It can be either Closed or Aborted depending on the value given as an input to the activity.

concurrencyMode String The mode of processing the batches.

It can be either serially or in parallel.

contentType String The content type for the job.

The values can be: CSV, XML, JSON. ZIP_CSV, ZIP_XML, ZIP_JSON

numberBatchesQueued Int The number of batches queued for this job.
numberBatchesInProgress Int The number of batches that are in progress for this job.
numberBatchesCompleted Int The number of batches that have been completed for this job.
numberBatchesFailed Int The number of batches that have failed for this job.
numberBatchesTotal Int The number of batches submitted for processing in this job.
numberRecordsProcessed Int The number of records already processed.

This number increases as more batches are processed.

numberRetries Int The number of times that Salesforce has attempted to save the result of an operation.
apiVersion String The API version of the job set in the URI when the job was created.
numberRecordsFailed Int The number of records that were not processed successfully in this job.
totalProcessingTime Int The time in milliseconds taken to process the job.

It is the sum of the total processing time for all batches in the job.

apiActiveProcessingTime Int The time in milliseconds taken to actively process the job and includes apexProcessingTime. However, it does not include the time that the job was in queue to be processed or the time required for serialization or deserialization.
apexProcessingTime Int The time in milliseconds taken to process triggers and other processes related to the job.

Fault

On the Fault tab, you can find the error code and error message of the Salesforce Close Job activity. See Error Codes for more information about error codes and corrective actions to take.

Fault Thrown when..
SalesforceRestException There is a problem with REST request, response or any other REST API error.
SalesforceLoginException An error occurs when logging in to the Salesforce.com server.
SalesforceConnectionNotFoundException An error occurs when the external session ID is not used or the Salesforce connection is not configured correctly.