liam_davison
I'm new here

How to get ScheduleContext and determine if DeltaGeneration is possible

Good morning,

I am writing an ExecutableToolbarActionsItem to enable my editors to trigger a delta generation and publish. Sometimes a delta generation is not possible, and in my schedule script I check to see if the delta can work:

deltaGeneration = DeploymentUtil.createDeltaGeneration(context).levelRule(1,4);

changeSet = deltaGeneration.calculateChangeSet();

changeSet.configureGenerateTask();

boolean isFullGeneration = changeSet.isFullGenerate();

I would like to know this information before the schedule is triggered, i.e. inside the ExecutableToolbarActionsItem and before I call:

ScheduleStorage scheduleStorage = _baseContext.requireSpecialist(ServicesBroker.TYPE).getService(AdminService.class).getScheduleStorage();

List<ScheduleEntry> allScheduleEntries = scheduleStorage.getScheduleEntries(project); // get all ScheduleEntries of the current project

...

ScheduleEntryControl control = scheduleEntry.execute();

Is it possible to get a ScheduleContext before executing the schedule entry?

Is there another way of determining if a generation will be delta or full before executing it?

I'd really like to give my editors the option of aborting a generation and publish if a Delta is not possible, as a full publish can hit the performance of the Portal server very hard.

Many thanks,

Liam Davison

0 Kudos
1 Reply
pavone
I'm new here

Liam,

to my knowledge it is not possible to get this information without a ScheduleContext and there is no way to get a ScheduleContext outside a schedule. If you want you can post a feature request here.

As a workaround you could probably create another schedule that only determines if a delta generation is possible or not. Then you could interpret the result in you ToolbarItem.

Best regards

Tim