newContainer.setCreator(user); newContainer.setIdentificationBarcode(containerSerialNumber); newContainer.setPartitionLimit(laneCount); newContainer.setPartitions(IntStream.range(0, laneCount) .mapToObj(i -> new PartitionImpl(newContainer, i + 1))
@Override public void execute(WorkflowExecutor workflowExecutor) throws IOException { if (!isComplete()) throw new IllegalStateException("Workflow is not complete"); SequencerPartitionContainer spc; if (containerStep.isExistingContainer()) { spc = containerStep.getContainer(); } else { spc = new SequencerPartitionContainerImpl(); SequencingContainerModel model = containerModelStep.getModel(); spc.setModel(model); spc.setIdentificationBarcode(containerStep.getBarcode()); spc.setPartitionLimit(model.getPartitionCount()); } for (int i = 0; i < partitionSteps.size(); ++i) { spc.getPartitionAt(i + 1).setPool(partitionSteps.get(i).getPool()); } workflowExecutor.save(spc); }