Search in sources :

Example 1 with CreateSelectionList

use of io.lumeer.engine.api.event.CreateSelectionList in project engine by Lumeer.

the class MongoSelectionListDao method createList.

@Override
public SelectionList createList(final SelectionList selection) {
    try {
        databaseCollection().insertOne(selection);
        if (createEvent != null) {
            mapList(selection);
            createEvent.fire(new CreateSelectionList(getOrganization().get().getId(), selection));
        }
        return selection;
    } catch (MongoException ex) {
        throw new StorageException("Cannot create selection list " + selection, ex);
    }
}
Also used : MongoException(com.mongodb.MongoException) CreateSelectionList(io.lumeer.engine.api.event.CreateSelectionList) StorageException(io.lumeer.storage.api.exception.StorageException)

Aggregations

MongoException (com.mongodb.MongoException)1 CreateSelectionList (io.lumeer.engine.api.event.CreateSelectionList)1 StorageException (io.lumeer.storage.api.exception.StorageException)1