我不明白为什么我不能在同一java类上使用execute()方法

时间:2019-12-04 14:52:07

标签: java

我想执行两次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));
    }
}

0 个答案:

没有答案