82316

Question:
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
<strong>Activities Class:</strong>
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;
}
}
<strong>Workflow Class:</strong>
public class MyWorkflowImpl implements MyWorkflow{
private SampleActivitiesClient client = new SampleActivitiesClientImpl();
@Override
public void executeActivity() {
client.testAct1();
client.testAct2();
}
}
Answer1: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.
Answer2:Look into scheduled events in Lambda. Will be the easiest way to achieve that.