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);
}
}
Aggregations