jrauschenbusch
I'm new here

How to find out if a generate task is a delta generation?

Jump to solution

Hello community,

is it possible to find out whether a generate task is a delta generation from inside an executable or a beanshell script? I don't want to start the delta generation by code. I just want to run a script after a generate task which behavior depends on this simple boolean value.

Thanks in advance!

--

Jochen

0 Kudos
1 Solution

Accepted Solutions
jrauschenbusch
I'm new here

Ok,

i've found the answer. Here is the reference on how to use the delta generation feature: DeltaGeneration - What is that and why I might need it?

2014-07-17 09_25_42-Auftragsplanung_ Auftrag bearbeiten.png

Here the code snippet of my Delta-Generation-Configuration-Script:

import de.espirit.firstspirit.access.schedule.*;


DeltaGeneration deltaGeneration = DeploymentUtil.createDeltaGeneration(context);

DeltaGeneration.ChangeSet changeSet = deltaGeneration.calculateChangeSet();

changeSet.configureGenerateTask();

context.setProperty("isDeltaGeneration", true);

context.setProperty("isFullGeneration", changeSet.isFullGenerate());

Here a code snippet of myExecutable:

public class ShowCaseExecutable implements Executable {

   void init(ScriptContext context) {
     Boolean isDeltaGeneration = (Boolean) context.getProperty("isDeltaGeneration");

     Boolean isFullGeneration = (Boolean) context.getProperty("isFullGeneration");

   }

}


If isDeltaGeneration == null (in the init method of the Exectuable) the Delta-Generation-Configuration-Script wasn't called before the generate task was performed and hence it could not be a delta generation. If isDeltaGeneration == true and isFullGeneration == false the generate task was performed as a real delta.

View solution in original post

0 Kudos
1 Reply
jrauschenbusch
I'm new here

Ok,

i've found the answer. Here is the reference on how to use the delta generation feature: DeltaGeneration - What is that and why I might need it?

2014-07-17 09_25_42-Auftragsplanung_ Auftrag bearbeiten.png

Here the code snippet of my Delta-Generation-Configuration-Script:

import de.espirit.firstspirit.access.schedule.*;


DeltaGeneration deltaGeneration = DeploymentUtil.createDeltaGeneration(context);

DeltaGeneration.ChangeSet changeSet = deltaGeneration.calculateChangeSet();

changeSet.configureGenerateTask();

context.setProperty("isDeltaGeneration", true);

context.setProperty("isFullGeneration", changeSet.isFullGenerate());

Here a code snippet of myExecutable:

public class ShowCaseExecutable implements Executable {

   void init(ScriptContext context) {
     Boolean isDeltaGeneration = (Boolean) context.getProperty("isDeltaGeneration");

     Boolean isFullGeneration = (Boolean) context.getProperty("isFullGeneration");

   }

}


If isDeltaGeneration == null (in the init method of the Exectuable) the Delta-Generation-Configuration-Script wasn't called before the generate task was performed and hence it could not be a delta generation. If isDeltaGeneration == true and isFullGeneration == false the generate task was performed as a real delta.

0 Kudos