use of org.onap.so.bpmn.common.BuildingBlockExecution in project so by onap.
the class FlowManipulatorListenerRunner method modifyFlows.
public void modifyFlows(List<ExecuteBuildingBlock> flowsToExecute, BuildingBlockExecution execution) {
int sequenceBeforeFlowManipulator;
do {
sequenceBeforeFlowManipulator = execution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
if (sequenceBeforeFlowManipulator >= flowsToExecute.size()) {
break;
}
ExecuteBuildingBlock currentBB = flowsToExecute.get(execution.getCurrentSequence());
List<PreFlowManipulator> filtered = filterListeners(flowManipulators, (item -> item.shouldRunFor(currentBB.getBuildingBlock().getBpmnFlowName(), execution.getCurrentSequence() == 0, execution)));
logger.info("Running pre flow manipulators:\n{}", filtered.stream().map(item -> item.getClass().getName()).collect(Collectors.joining("\n")));
filtered.forEach(item -> item.run(flowsToExecute, currentBB, execution));
} while (isBuildingBlockSkipped(sequenceBeforeFlowManipulator, execution));
}
use of org.onap.so.bpmn.common.BuildingBlockExecution in project so by onap.
the class AbstractCDSProcessingBBUtilsTest method sendRequestToCDSClientBBTest.
@Test
public void sendRequestToCDSClientBBTest() {
BuildingBlockExecution execution = mock(BuildingBlockExecution.class);
when(execution.getVariable("executionServiceInput")).thenReturn(abstractCDSPropertiesBean);
abstractCDSProcessingBBUtils.sendRequestToCDSClientBB(execution);
verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), anyInt(), any(Exception.class));
}
use of org.onap.so.bpmn.common.BuildingBlockExecution in project so by onap.
the class GenericCDSProcessingBB method prepare.
@Override
public void prepare(ControllerContext<BuildingBlockExecution> context) {
BuildingBlockExecution buildingBlockExecution = context.getExecution();
try {
AbstractCDSPropertiesBean abstractCDSPropertiesBean = generatePayloadForCds.buildCdsPropertiesBean(buildingBlockExecution);
buildingBlockExecution.setVariable(EXECUTION_OBJECT, abstractCDSPropertiesBean);
} catch (Exception ex) {
logger.error("An exception occurred when creating payload for CDS request", ex);
exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 7000, ex);
}
}
use of org.onap.so.bpmn.common.BuildingBlockExecution in project so by onap.
the class GenericPnfCDSControllerRunnableBB method run.
@Override
public void run(ControllerContext<BuildingBlockExecution> controllerContext) {
BuildingBlockExecution buildingBlockExecution = controllerContext.getExecution();
abstractCDSProcessingBBUtils.constructExecutionServiceInputObjectBB(buildingBlockExecution);
abstractCDSProcessingBBUtils.sendRequestToCDSClientBB(buildingBlockExecution);
}
Aggregations