Uploaded image for project: 'Service Orchestrator'
  1. Service Orchestrator
  2. SO-1906

"Cannot serialize object in variable" Exception in vCPE custom workflow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Highest Highest
    • Dublin Release
    • Dublin Release

      When calling SO api to instantiate vCPE customer service, an error message "Exception in getParentServiceInstance. Cannot serialize object in variable 'PSI_resourceLink': java.util.Optional" was returned.  

      It looks to me the exception is thrown from the following function of https://git.onap.org/so/tree/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy?h=dublin

      	public void getParentServiceInstance(DelegateExecution execution) {
      		logger.trace("getParentServiceInstance ")
      		try {
      			String serviceInstanceId = execution.getVariable('parentServiceInstanceId')
      
      			AAIResourcesClient resourceClient = new AAIResourcesClient()
      			AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
      
      			try {
      				//just to make sure the serviceInstance exists
      				uri.build()
      				execution.setVariable("PSI_resourceLink", uri)
      			} catch (NotFoundException e) {
      				exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai")
      			}
      
      		}catch(BpmnError e) {
      			throw e;
      		}catch (Exception ex){
      			String msg = "Exception in getParentServiceInstance. " + ex.getMessage()
      			logger.debug(msg)
      			exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
      		}
      		logger.trace("Exit getParentServiceInstance ")
      	}
      

            xuyang11 xuyang11
            xuyang11 xuyang11
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: