qc.setType(workflowExecutor.getQcTypeList().stream().filter(type -> type.getQcTarget() == QcTarget.Sample).findFirst().orElse(null)); qc.setResults(qcStep.getQCValue()); SampleAliquot aliquot = workflowExecutor.createAliquotFromParent(sample); aliquot.setVolume(((VolumeStep) aliquotHandlingSteps.get(3 * i + 1)).getVolume()); aliquot.setConcentration(((ConcentrationStep) aliquotHandlingSteps.get(3 * i + 2)).getConcentration()); workflowExecutor.save(aliquot); String aliquotPos = ((AliquotBoxPositionStep) aliquotHandlingSteps.get(3 * i)).getPosition(); BoxPosition aliquotBp = new BoxPosition(aliquotBox, aliquotPos, aliquot.getEntityType(), aliquot.getId()); workflowExecutor.save(aliquotBox); workflowExecutor.save(qc); workflowExecutor.save(sample); workflowExecutor.save(stockBox);
@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); }