tyoshikawa1106のブログ

- Force.com Developer Blog -

SFDC:Summer'15 - System.moveFlexQueueJobで実行順序変更

Summer'15のバージョンアップで追加された『System.moveFlexQueueJob』を利用すると待機中のジョブの実行順序を変更できるみたいです。

f:id:tyoshikawa1106:20150506142704p:plain


実際に動かせてはいないのですが次のような感じだと思います。

String jobId = Database.executeBatch(new AccountSampleBatch(), 200);
Integer positionNumber = 1;
Boolean isSuccess = System.moveFlexQueueJob(jobId, positionNumber);


JobIDはApexジョブで確認できるApex ジョブ IDのことだと思います。
f:id:tyoshikawa1106:20150506142953p:plain

Reorder Your Batch Jobs in the Flex Queue Programmatically