简体   繁体   English

Salesforce Bulk API作业优先级

[英]Salesforce Bulk API job priority

I have a tree of hierarchical data. 我有一棵分层数据树。 After tree is built (~300k nodes of 16 different types) I need to push it into Salesforce 16 custom objects in a specific order, parents first then childs, so I have 16 jobs with batches inside. 构建完树之后(约30万个16种不同类型的节点),我需要按特定顺序将其推入Salesforce 16个自定义对象中,首先是父级,然后是子级,因此我有16个作业,其中有批处理。

The problem is that Salesforce handles jobs in parallel and random order so mapping by external ID is failed all the time, childs may be inserted earlier so on. 问题在于,Salesforce以并行和随机顺序处理作业,因此始终无法通过外部ID进行映射,因此可能会更早地插入子级。

Any ideas how to resolve it? 任何想法如何解决呢?

Thanks. 谢谢。

You could use Apex Flex Queue to actively manage the order of the queued jobs to control which batch jobs are processed first. 您可以使用Apex Flex Queue主动管理排队作业的顺序,以控制首先处理哪些批处理作业。

public class AsyncExecutionExample implements Queueable {
    public void execute(QueueableContext context) {
        // Your processing logic here
        // Chain this job to next job by submitting the next job
        System.enqueueJob(new SecondJob());
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM