问题
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