use of org.apache.isis.applib.fixturescripts.FixtureResult in project estatio by estatio.
the class OrderInvoiceImportForDemoXlsxFixture method execute.
@Override
protected void execute(final ExecutionContext executionContext) {
setExcelResource(Resources.getResource(getClass(), "OrderInvoiceImportForDemo.xlsx"));
setMatcher(sheetName -> {
if (sheetName.startsWith("OXFORD")) {
return new WorksheetSpec(rowFactoryFor(OrderInvoiceImportHandler.class, executionContext), sheetName, Mode.RELAXED);
} else {
return null;
}
});
super.execute(executionContext);
for (FixtureResult result : executionContext.getResults()) {
if (result.getClassName().equals(OrderInvoiceLine.class.getName())) {
OrderInvoiceLine line = (OrderInvoiceLine) result.getObject();
OrderInvoiceLine._apply applyMixin = factoryService.mixin(OrderInvoiceLine._apply.class, line);
if (applyMixin.disableAct() == null) {
applyMixin.act();
}
}
}
}
use of org.apache.isis.applib.fixturescripts.FixtureResult in project estatio by estatio.
the class EstatioSecurityModuleFixturesMenu method installFixturesAndReturnFirstRole.
// //////////////////////////////////////
@Action(semantics = SemanticsOf.NON_IDEMPOTENT, restrictTo = RestrictTo.PROTOTYPING)
@ActionLayout(cssClassFa = "fa-bolt")
@MemberOrder(sequence = "20")
public Object installFixturesAndReturnFirstRole() {
final List<FixtureResult> fixtureResultList = fixtureScripts.findFixtureScriptFor(EstatioSecurityModuleSeedFixture.class).run(null);
for (FixtureResult fixtureResult : fixtureResultList) {
final Object object = fixtureResult.getObject();
if (object instanceof ApplicationRole) {
return object;
}
}
container.warnUser("No rules found in fixture; returning all results");
return fixtureResultList;
}
Aggregations