Search the FirstSpirit Knowledge Base
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
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?
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.
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?
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.