Skip to content

Instantly share code, notes, and snippets.

@nidri
Created January 15, 2022 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nidri/46c7a7ef48feb27830d51cab111f68d7 to your computer and use it in GitHub Desktop.
Save nidri/46c7a7ef48feb27830d51cab111f68d7 to your computer and use it in GitHub Desktop.
Pega - Get instances from DeferredOps into Pagelist - SAVE operations
// Create a Code-Pega-List page
tools.createPage("Code-Pega-List", "Instances");
// Connect to Pega DB and get deferred operations
PegaDatabase db = (PegaDatabase) tools.getDatabase();
java.util.Iterator deferredOps = db.getDeferredOps().iterator();
while (deferredOps.hasNext()) {
ClipboardPage instancePage = null;
DeferredOperation op = (DeferredOperation) deferredOps.next();
// Getting instances only for SAVE operations
if (op instanceof DeferredOperation.SaveInstance) {
DeferredOperation.SaveInstance saveInstance = (DeferredOperation.SaveInstance) op;
instancePage = saveInstance.getInstance();
tools.findPage("Instances").getProperty("pxResults").add(instancePage);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment