Search in sources :

Example 1 with PromiseExecutionOperation

use of org.activityinfo.promise.PromiseExecutionOperation in project activityinfo by bedatadriven.

the class SchemaImporterV3 method persist.

@Override
public void persist(final AsyncCallback<Void> callback) {
    List<PromiseExecutionOperation> operations = new ArrayList<>();
    for (final FormClass formClass : toSave()) {
        operations.add(new PromiseExecutionOperation() {

            @Nullable
            @Override
            public Promise<Void> apply(@Nullable Void aVoid) {
                return locator.persist(formClass);
            }
        });
    }
    PromisesExecutionGuard.newInstance().executeSerially(operations).then(callback);
}
Also used : PromiseExecutionOperation(org.activityinfo.promise.PromiseExecutionOperation) Promise(org.activityinfo.promise.Promise) FormClass(org.activityinfo.model.form.FormClass) Nullable(javax.annotation.Nullable)

Aggregations

Nullable (javax.annotation.Nullable)1 FormClass (org.activityinfo.model.form.FormClass)1 Promise (org.activityinfo.promise.Promise)1 PromiseExecutionOperation (org.activityinfo.promise.PromiseExecutionOperation)1