// pipeline IDataCursor pipelineCursor = pipeline.getCursor(); IData exceptionHandlerInput = IDataUtil.getIData( pipelineCursor, "exceptionHandlerInput" ); InvokeState is = InvokeState.getCurrentState(); if(is == null) throw new ServiceException(INVOKESTATE_NOT_AVAIL); FlowState fs = is.getFlowState(); if(fs == null) throw new ServiceException(INVOKED_OUTOF_FLOW); IData info = fs.getLastErrorInfo(); if(info != null) { IData binfo = IDataFactory.create(); IDataUtil.append(info, binfo); Object cp = ValuesEmulator.get(binfo, "pipeline"); if(cp instanceof IData) { IData callpipe = (IData)cp; ValuesEmulator.remove(callpipe, "$errorInfo"); ValuesEmulator.remove(callpipe, "$errorDump"); ValuesEmulator.remove(callpipe, "$error"); ValuesEmulator.remove(callpipe, "$errorType"); } else { ValuesEmulator.remove(binfo, "pipeline"); } /*******************************Invoke exceptionHandler with lastError doc************************************/ try { String exceptionHandlerService = "z.frameworks.exceptionHandlingPOC.forCatch:exceptionHandler"; NSName nsName = NSName.create(exceptionHandlerService); IData input = IDataFactory.create(); IDataCursor inputCursor = input.getCursor(); IDataUtil.put(inputCursor, "exceptionHandlerInput", exceptionHandlerInput); IDataUtil.put(inputCursor, "lastError", binfo); IData results = Service.doInvoke(nsName, input); IDataCursor resultsCursor = results.getCursor(); IData exceptionHandlerOutput = IDataUtil.getIData(resultsCursor, "exceptionHandlerOutput" ); if (exceptionHandlerOutput != null) { ValuesEmulator.put(pipeline, "exceptionHandlerOutput", exceptionHandlerOutput); } inputCursor.destroy(); resultsCursor.destroy(); } catch (Exception e) { throw new ServiceException(e); } } else { ValuesEmulator.remove(pipeline, "lastError"); } pipelineCursor.destroy();