@Override
protected void doTask(Map<Object, Object> context) throws Exception {
Long activityId = (Long) context.get("activityId");
String[] targets = (String[]) context.get("targets");
if(targets!=null) {
Activity activity = activityService.getActivity(activityId);
for(String target : targets) {
Token accessToken = getAccessToken(target, activity.getEnteredBy());
ApiService apiService = getApiService(target);
Map<String, Object> params = CollectionUtil.newHashMap();
params.put("format", "json");
params.put("accessToken", accessToken);
params.put("status", activity.getDescription());
apiService.updateStatus(params);
}
}
}