Executing Workflow using AWS SWF Cron

会有一股神秘感。 提交于 2019-12-13 06:53:52

问题


I want to execute my workflow at a specified time daily(say at 10 am JST) using AWS SWF cron. In the sample program in AWS SDK I find that activities can be scheduled using SWF cron. But how to schedule a workflow using AWS SWF cron. I am very much new to this SWF cron. Any suggestion is highly appreciated

Activities Class:

public class SampleActivitiesImpl implements SampleActivities{

    @Override
    public Integer testAct1() {
        System.out.println("Activity 1 ---->Start");
        return 1;
    }

    @Override
    public Integer testAct2() {
        System.out.println("Activity 2 ---->Start");
        return 1;
    }
}

Workflow Class:

public class MyWorkflowImpl implements MyWorkflow{

    private SampleActivitiesClient client = new SampleActivitiesClientImpl();

    @Override
    public void executeActivity() {

        client.testAct1();
        client.testAct2();
    }
}

回答1:


You don't schedule the cron workflow as it should be always running. BTW your sample code is just going to execute both activities in parallel without any scheduling.




回答2:


Look into scheduled events in Lambda. Will be the easiest way to achieve that.



来源:https://stackoverflow.com/questions/28019926/executing-workflow-using-aws-swf-cron

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!