I have requirement like, i have to take the Value objects as input and i have to wirte those value objects to XLS.
For that i have devloped a custom Component
public Result execute() throws Exception {
InputPortDirect inPort = (InputPortDirect) getInputPort(READ_FROM_PORT);;
List<DealDetailsVO> dealDetailsVOList = new PMIFacade().processDealExtract();
Iterator<DealDetailsVO> iterator = dealDetailsVOList.iterator();
while (iterator.hasNext() && runIt) {
DealDetailsVO dealDetailsVO = (DealDetailsVO) iterator.next();
outRecord.getField("ACCOUNTID").setValue(dealDetailsVO.getAccountId());
outRecord.getField("DEALID").setValue(dealDetailsVO.getDealId());
outRecord.getField("DEALNAME").setValue(dealDetailsVO.getDealName());
outRecord.getField("BUSINESSSEGMENT").setValue(dealDetailsVO.getBusinessSegment());
outRecord.getField("BUSINESSSUBSEGMENT").setValue(dealDetailsVO.getBusinessSubSegment());
outRecord.getField("ORIGINATINGLOCATION").setValue(dealDetailsVO.getOriginatingLocation());
outRecord.getField("BOOKINGLOCATION").setValue(dealDetailsVO.getBookingLocation());
outRecord.getField("DATEFIRSTINPIPELINE").setValue(dealDetailsVO.getDateFirstInPipeline());
outRecord.getField("CLOSEDDATE").setValue(dealDetailsVO.getClosedDate());
outRecord.getField("LOSTDATE").setValue(dealDetailsVO.getLostDate());
outRecord.getField("SALESSTAGE").setValue(dealDetailsVO.getSalesStage());
outRecord.getField("UPDATEDTOTALANNUALREVENUE").setValue(dealDetailsVO.getUpdatedTotalAnnualRevenue());
outRecord.getField("PRODUCTTYPE").setValue(dealDetailsVO.getProductType());
outRecord.getField("SUBPRODUCTTYPE").setValue(dealDetailsVO.getSubProductType());
outRecord.getField("ACCOUNTNAME").setValue(dealDetailsVO.getAccountName());
outRecord.getField("ACCTGROUPID").setValue(dealDetailsVO.getAcctGroupId());
outRecord.getField("ACCTLEID").setValue(dealDetailsVO.getAcctLEId());
outRecord.getField("ACCTSUBPROFILEID").setValue(dealDetailsVO.getAcctSubProfileId());
outRecord.getField("CREATEDDATE").setValue(dealDetailsVO.getCreatedDate());
getOutputPort(0).writeRecord(outRecord);
SynchronizeUtils.cloverYield();
}
return runIt ? Result.FINISHED_OK : Result.ABORTED;
}
And i have created the grf file based on the custom component. i calling the graph file through java like this
EngineInitializer.initEngine("C:\\cloverETL.rel-3-0-0\\cloverETL\\plugins", null, null);
String graphPath = "c:\\cloverETL.rel-3-0-0\\cloverETL\\bin\\graph\\tets.grf";
InputStream is = new BufferedInputStream(new FileInputStream(graphPath));
TransformationGraph graph = null;
// engine customizationnm
GraphRuntimeContext runtimeContext = new GraphRuntimeContext();
// graph loading
graph = TransformationGraphXMLReaderWriter.loadGraph(is,runtimeContext);
// engine initialization
EngineInitializer.initGraph(graph, runtimeContext);
// graph running
IThreadManager threadManager = new SimpleThreadManager();
WatchDog watchDog = new WatchDog(graph, runtimeContext);
threadManager.executeWatchDog(watchDog);
it is execeuting fine.
But right now my requirement is like. While calling the graph it self i need to pass some input parameters. i.e what ever the method i am calling in execute() (new PMIFacade().processDealExtract() ) requires some input parameter. i .e the new method will looks like new PMIFacade().processDealExtract(int a, string b). i nned to pass those inputs while calling the grah.
can anyone help on this.
Thanks in advance
Venkat