我想执行两次Programmatic服务来调用ordrer中的两个Java类,以从仪表板中的两个不同表中删除元素
public class PurgeSchedule extends ScheduledTask {
@Override
public void execute(ScheduledExecutionContext ctx) throws OperationException, ScheduledTaskInterruption {
Repository repository = ctx.getRepository();
AdaptationHome dataspace = repository.lookupHome(HomeKey.forBranchName("Reference"));
if (dataspace == null) {
throw OperationException.createError("Cannot find dataspace");
}
Adaptation dataset = dataspace.findAdaptationOrNull(AdaptationName.forName(CommonPaths.EVE_DATASET_NAME));
if (dataset == null) {
throw OperationException.createError("Cannot find dataset");
}
AdaptationTable tableEquipements = dataset.getTable(EvePaths._VITRINE_Equipments_ScheduleEquipments.getPathInSchema());
AdaptationTable tableEvents = dataset.getTable(EvePaths._VITRINE_Events.getPathInSchema());
ProgrammaticService ps = ProgrammaticService.createForSession(ctx.getSession(), dataspace);
ps.execute(new PurgeTaskEquipements(dataspace, tableEquipements));
ProgrammaticService psq = ProgrammaticService.createForSession(ctx.getSession(), dataspace);
psq.execute(new PurgeTaskEvents(dataspace, tableEvents));
}
}