위치:
프로그램 방식 작업 호출
VlocityBatchFramework 메서드를 사용하여 쿼리의 데이터 소스 유형으로 예약된 작업을 시작합니다. 모든 작업, 여러 작업 또는 단일 작업을 시작할 수 있습니다. 또한 통합 절차 또는 VlocityOpenInterface를 작업으로 호출할 수 있습니다.
데이터 소스 유형 쿼리를 사용하여 예약된 모든 작업을 즉시 시작하려면 익명 Apex를 사용하여 VlocityBatchFramework.startScheduledJobs() 메서드를 호출하고 다음과 같이 모든 매개 변수를 생략합니다.
VlocityBatchFramework.startScheduledJobs();
데이터 소스 유형 쿼리를 사용하여 예약된 단일 작업을 즉시 시작하려면 익명 Apex를 사용하여 VlocityBatchFramework.startScheduledJob() 메서드를 호출하고 실행할 작업의 ID를 지정합니다. 예:
VlocityBatchFramework.startScheduledJob('a3Zf4000000J81v');
데이터 소스 유형 쿼리를 사용하여 여러 예약된 작업을 즉시 시작하려면 익명 Apex를 사용하여 VlocityBatchFramework.startScheduledJobs() 메서드를 호출하고 실행할 작업의 ID 목록을 지정합니다. 예:
VlocityBatchFramework.startScheduledJobs(new List<Id>{'a3Zf4000000J81v', 'a3Zf4000000IwIU'});
배치 프레임워크를 사용하면 모든 Integration Procedure 또는 VlocityOpenInterface를 작업으로 프로그래밍 방식으로 호출할 수도 있습니다. 배치 작업을 시작하는 방법은 다음과 같습니다.
VlocityBatchFramework.startIntegrationProcedureBatch(String integrationProcedureKey, List<Object> input, new Map<String, Object> options);
VlocityBatchFramework.startOpenInterfaceBatch(String classMethod, List<Object> input, new Map<String, Object> options);
Apex 통합 절차 작업을 시작하려면 다음 명령을 실행합니다.
VlocityBatchFramework.startIntegrationProcedureBatch({integration procedure key}, input list, options map);
예:
VlocityBatchFramework.startIntegrationProcedureBatch('VlocityBatchFramework_ValidateAccountBillingStreet', accounts, new Map<String, Object>{'isInputAsList' => true, 'batchSize' => 20});
지정된 클래스의 invokeMethod를 실행하는 비동기 Apex 작업을 시작하려면 다음 명령을 실행합니다.
VlocityBatchFramework.startOpenInterfaceBatch({ Class name . method name }, input list, options map);
예:
VlocityBatchFramework.startOpenInterfaceBatch('VlocityBatchFrameworkTestOI4.updateStatus', accounts, new Map<String, Object>{'isInputAsList' => false, 'batchSize' => 20});
통합 절차를 실행하는 예약된 작업을 연결하려면 작업 ID를 제공하고 true로 설정된 연결 가능한 옵션을 포함합니다.
startScheduledJobs(new Map<String, Object>{‘vlocityScheduledJobIds’ => new List<String>{‘JobId’, 'JobId2'}, new Map<String, Object>{'chainable' => true});
예:
VlocityBatchFramework.startScheduledJobs(new Map<String, Object>{'vlocityScheduledJobIds' => new List<String>{'a3Zf4000000T7A1', 'a3Zf4000000T7A6'}}, new Map<String, Object>{'chainable' => true});
작업을 프로그래밍 방식으로 호출할 때 옵션 맵에서 다음 옵션을 지정할 수 있습니다. 자세한 내용은 위를 참조하십시오.
-
batchSize
-
chainable: 통합 절차가 포함된 작업만 연결할 수 있습니다.
-
isInputAsList
-
jobQueue
다음 방법을 사용하면 프로그래밍 방식으로 작업 실행을 관리할 수 있습니다.
-
getCurrentBatchJobs(): "중단됨", "완료됨" 또는 "실패"가 아닌 AsyncApexJobs를 반환합니다. -
abortBatchJobs(): "VlocityBatchFramework"로 명명된 모든 AsyncApexJobs를 중단합니다. -
getScheduledBatchJob(): 이름이 "VlocityScheduledJob"인 CronTrigger를 반환합니다. -
abortScheduledBatchJob(): "VlocityScheduledJob"로 명명된 CronTrigger를 중단하려고 합니다.

