use of org.onap.so.bpmn.common.DelegateExecutionImpl in project so by onap.
the class AbstractVnfCDSRequestProviderTest method createBuildingBlockExecution.
protected BuildingBlockExecution createBuildingBlockExecution() {
DelegateExecution execution = new DelegateExecutionFake();
execution.setVariable(GENERAL_BLOCK_EXECUTION_MAP_KEY, createGeneralBuildingBlock());
return new DelegateExecutionImpl(execution);
}
use of org.onap.so.bpmn.common.DelegateExecutionImpl in project so by onap.
the class ConfigAssignVnfTest method createBuildingBlockExecution.
private BuildingBlockExecution createBuildingBlockExecution(Object serviceJson) {
DelegateExecution execution = new DelegateExecutionFake();
execution.setVariable(GENERAL_BLOCK_EXECUTION_MAP_KEY, createGeneralBuildingBlock(serviceJson));
return new DelegateExecutionImpl(execution);
}
use of org.onap.so.bpmn.common.DelegateExecutionImpl in project so by onap.
the class GenericCDSProcessingBBTest method createBuildingBlockExecution.
private BuildingBlockExecution createBuildingBlockExecution() {
DelegateExecution execution = new DelegateExecutionFake();
execution.setVariable(GENERAL_BLOCK_EXECUTION_MAP_KEY, createGeneralBuildingBlock());
return new DelegateExecutionImpl(execution);
}
use of org.onap.so.bpmn.common.DelegateExecutionImpl in project so by onap.
the class PrepareSdncUpgradePreCheckPnfBBTest method prepareBuildingBlockExecution.
private BuildingBlockExecution prepareBuildingBlockExecution(String payload) {
DelegateExecution execution = new DelegateExecutionFake();
execution.setVariable("payload", payload);
return new DelegateExecutionImpl(execution);
}
use of org.onap.so.bpmn.common.DelegateExecutionImpl in project so by onap.
the class BBInputSetup method execute.
/**
* This method is used for executing the building block.
*
* It will get the BB from the execution object by checking if the aLaCarte and homing is true.
*
* Then it will get the GBB and execute it.
*
* @param execution
* @throws Exception
* @return
*/
@Override
public void execute(DelegateExecution execution) throws Exception {
try {
GeneralBuildingBlock outputBB = null;
ExecuteBuildingBlock executeBB = this.getExecuteBBFromExecution(execution);
String resourceId = executeBB.getResourceId();
String requestAction = executeBB.getRequestAction();
String vnfType = executeBB.getVnfType();
boolean aLaCarte = Boolean.TRUE.equals(executeBB.isaLaCarte());
boolean homing = Boolean.TRUE.equals(executeBB.isHoming());
Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
outputBB = this.getGBB(executeBB, lookupKeyMap, requestAction, aLaCarte, resourceId, vnfType);
ObjectMapper mapper = new ObjectMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
logger.debug("GeneralBB: " + mapper.writeValueAsString(outputBB));
setHomingFlag(outputBB, homing, lookupKeyMap);
execution.setVariable(FLOW_VAR_NAME, executeBB.getBuildingBlock().getBpmnFlowName());
execution.setVariable(GBB_INPUT_VAR_NAME, outputBB);
execution.setVariable(LOOKUP_KEY_MAP_VAR_NAME, lookupKeyMap);
if (outputBB.getRequestContext().getIsHelm()) {
execution.setVariable("isHelm", true);
} else {
execution.setVariable("isHelm", false);
}
BuildingBlockExecution gBuildingBlockExecution = new DelegateExecutionImpl(execution);
execution.setVariable("gBuildingBlockExecution", gBuildingBlockExecution);
execution.setVariable("RetryCount", 1);
execution.setVariable("handlingCode", "Success");
} catch (Exception e) {
logger.error("Exception occurred", e);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, e.getMessage());
}
}
Aggregations