class ControllerExecution {

    public void selectBB(BuildingBlockExecution execution) {
        try {

            String controllerActor = execution.getVariable(CONTROLLER_ACTOR);
            String action = Optional.of((String) execution.getVariable(ACTION)).get();
            String scope = Optional.of((String) execution.getVariable(SCOPE)).get();
            BBNameSelectionReference bbNameSelectionReference =
                    catalogDbClient.getBBNameSelectionReference(controllerActor, scope, action);
            String bbName = bbNameSelectionReference.getBbName();
            execution.setVariable(BBNAME, bbName);
            logger.debug(" Executing {} BPMN", bbName);
        } catch (Exception ex) {
            logger.error("An exception occurred while getting bbname from catalogdb ", ex);
            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);

        }

    }

}