class CreateRelation implements JavaDelegate {

    @Override
    public void execute(DelegateExecution delegateExecution) {
        String serviceInstanceId = (String) delegateExecution.getVariable("serviceInstanceId");
        String pnfName = (String) delegateExecution.getVariable("pnfCorrelationId");
        try {
            pnfManagementImpl.createRelation(serviceInstanceId, pnfName);
        } catch (Exception e) {
            logger.error("An exception occurred when making service and pnf relation. Exception:", e);
            new ExceptionUtil().buildAndThrowWorkflowException(delegateExecution, 9999,
                    "An exception occurred when making service and pnf relation. Exception: " + e.getMessage());
        }
        logger.debug("The relation has been made between service with id: {} and pnf with name: {}", serviceInstanceId,
                pnfName);
    }

    @Autowired public  CreateRelation(PnfManagement pnfManagementImpl);

}