See: Description
Interface | Description |
---|---|
JobParameters |
Methods to set values for job parameters.
|
JobService |
Service interface to run jobs with specified parameters.
|
This package provides interfaces to execute asynchronous jobs.
//Get an instance of job for invoking user actions
JobService jobService = ServiceLocator.locate(JobService.class);
JobParameters jobParameters = jobService.newJobParameters("record_user_action__v");
//Run job to invoke user action to change state
jobParameters.setValue("user_action_name", "change_state_to_in_use_useraction__c");
jobParameters.setValue("records", records);
jobService.run(jobParameters);
The user_action_name
parameter value, change_state_to_in_use_useraction__c
, is from the configured lifecycle.
It is derived by taking the lifecycle user action label in lower case, replacing any spaces with underscore, and
appending _useraction__c
.
The records
parameter specifies the set of records to change state.
JobService
supports the following controls:
JobService
, this must be set to Use
roles as participants or Use custom action to define participants.
JobService
cannot start a workflow from a RecordAction
with the
LIFECYCLE_ENTRY_ACTION
Usage
.
The following illustrates running a job to invoke a lifecycle user action to start a workflow.
//Get an instance of job for invoking user actions
JobService jobService = ServiceLocator.locate(JobService.class);
JobParameters jobParameters = jobService.newJobParameters("record_user_action__v");
//Run job to invoke user action to start workflow
jobParameters.setValue("user_action_name", "evaluate_country_brand_useraction__c");
jobParameters.setValue("records", records);
jobParameters.setValue("review_date__c", LocalDate.now().plusMonths(1));
jobService.run(jobParameters);
The user_action_name
parameter value, e.g. "evaluate_country_brand_useraction__c", is from the configured
lifecycle. It is derived by taking the lifecycle user action label in lower case, replacing any spaces with
underscore, and appending _useraction__c
. Note that your vault may name actions differently. To get the
names of actions in your vault, Retrieve Object Record
User Actions with the Vault REST API.
The records
parameter specifies the set of records to start the workflow.
Copyright © Veeva Systems 2017–2019. All rights reserved.