Search in sources :

Example 1 with DummySequenceOperation

use of io.lumeer.core.task.executor.operation.DummySequenceOperation in project engine by Lumeer.

the class LumeerBridge method getSequenceNumber.

@SuppressWarnings("unused")
public String getSequenceNumber(final String sequenceName, final int digits) {
    final String format = "%" + (digits <= 1 ? "" : "0" + digits) + "d";
    if (dryRun) {
        return String.format(format, 1);
    } else {
        final int sequenceValue = task.getDaoContextSnapshot().getSequenceDao().getNextSequenceNo(sequenceName);
        operations.add(new DummySequenceOperation(sequenceName));
        changesTracker.addSequence(sequenceName);
        return String.format(format, sequenceValue);
    }
}
Also used : DummySequenceOperation(io.lumeer.core.task.executor.operation.DummySequenceOperation)

Aggregations

DummySequenceOperation (io.lumeer.core.task.executor.operation.DummySequenceOperation)1