IData input = IDataFactory.create(); IData result=IDataFactory.create(); IData body=IDataFactory.create(); IData cacheData=IDataFactory.create(); IDataCursor pipeLineCursor=pipeline.getCursor(); IDataCursor inputCursor = input.getCursor(); IDataCursor resultCursor=result.getCursor(); IDataCursor bodyCursor=body.getCursor();; IDataCursor cacheDataCursor=cacheData.getCursor(); Object keyObject=null; Context context=null; String server="some value"; String username="some value"; String password="some value"; String keyToCache=null; String dataToCache=null; String xmlFileData=null; String xmlFileName=null; CacheManager cacheManager=null; CacheConfiguration cacheConfig=null; Ehcache cacheObject=null; Element element=null; Searchable searchable=new Searchable(); SearchAttribute sa=null; File file=null; Map mapObject=null; try { try { context=new Context(); context.connect(server,username,password); } catch(Exception e) { e.printStackTrace(); throw new ServiceException("\n"+"Could not connect to the Server"); } try { file=new File("/apps/wm/ENT_IS2/webMethods80/IntegrationServer/packages/DeveloperPOC/config/ehcache.xml"); } catch(Exception e) { e.printStackTrace(); throw new ServiceException("\n"+"Could not find file"); } try { keyToCache=IDataUtil.getString(pipeLineCursor,"KeyToCache"); dataToCache=IDataUtil.getString(pipeLineCursor,"DataToCache"); } catch(Exception e) { e.printStackTrace(); throw new ServiceException("\n"+"Could not retrieve data from pipeline"); } element=new Element(keyToCache,dataToCache); mapObject=new HashMap(); //xmlFileName=file.getAbsolutePath(); xmlFileName=file.toString(); //xmlFileName="/apps/wm/ENT_IS2/webMethods80/IntegrationServer/packages/DeveloperPOC/config/ehcache.xml"; cacheManager=new CacheManager(xmlFileName); cacheConfig=new CacheConfiguration("cache",300).memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU) .overflowToDisk(false).eternal(false).timeToLiveSeconds(60).timeToIdleSeconds(30) .diskPersistent(false).diskExpiryThreadIntervalSeconds(0); cacheObject=new Cache(cacheConfig); cacheManager.addCache(cacheObject); cacheObject=cacheManager.getEhcache("cache"); cacheObject.put(element); for(Object key:cacheObject.getKeys()) { mapObject.put((String) key, (Object) cacheObject.get(key).getObjectValue()); keyObject=key; sa=new SearchAttribute(); sa.setName((String) cacheObject.get(keyObject).getObjectKey()); sa.setExpression((String) cacheObject.get(keyObject).getObjectValue()); cacheConfig.addSearchable(searchable); searchable.addSearchAttribute(sa); } IDataUtil.put(inputCursor,"filename",xmlFileName); IDataUtil.put(inputCursor,"loadAs","string" ); try { result=context.invoke("pub.file","getFile",input); } catch(Exception e) { e.printStackTrace(); throw new ServiceException("\n"+"Could not invoke the file"); } try { body=IDataUtil.getIData(resultCursor,"body"); if(body!=null) { xmlFileData=IDataUtil.getString(bodyCursor,"string"); } } catch(Exception e) { e.printStackTrace(); throw new ServiceException("\n"+"Could not retrieve data from the file"); } } catch(Exception e) { e.printStackTrace(); } finally { try { if(xmlFileData!=null) { IDataUtil.put(pipeLineCursor, "XMLData",(Object) xmlFileData); } else { throw new ServiceException("\n"+"File data does not exist"); } for(int i=0;i