Support Article

Data flow invoking Activity with ConnectFile step error with NPE

SA-30875

Summary



User implemented a simple Data Flow that reads from table via Report Definition and calls activity that writes out results to a File via Connect-File method.
The data decision flow(DDF) when run manually errors out in the Activity:Connect-File step.

The location of the file path is valid as we are seeing the Pega Marketing application already writing data to flat file at that location.

Connect-File step shows Null Pointer exception.

Error Messages



Exception in stage: WriteToFile at com.pega.dsm.dnode.api.dataflow.DataFlowStage$StageOutputSubscriber.onError(DataFlowStage.java:394) at com.pega.dsm.dnode.api.dataflow.DataFlowStageProcessor.onError(DataFlowStageProcessor.java:48) at com.pega.dsm.dnode.api.dataflow.DataFlowStage$StageInputSubscriber.onError(DataFlowStage.java:286) at com.pega.dsm.dnode.api.dataflow.DataFlowExecutor$QueueBasedDataFlowExecutor$3.process(DataFlowExecutor.java:202) at com.pega.dsm.dnode.api.dataflow.DataFlowExecutor$QueueBasedDataFlowExecutor.runEventLoop(DataFlowExecutor.java:119) at com.pega.dsm.dnode.api.dataflow.DataFlow$1.emit(DataFlow.java:162) at com.pega.dsm.dnode.impl.stream.DataObservableImpl.subscribe(DataObservableImpl.java:56) at com.pega.dsm.dnode.impl.dataflow.manager.LocalRun.execute(LocalRun.java:145) at com.pega.dsm.dnode.impl.dataflow.manager.LocalRun.lockAndRun(LocalRun.java:86) at com.pega.dsm.dnode.impl.dataflow.manager.LocalRun.run(LocalRun.java:63) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:483) at java.util.concurrent.FutureTask.run(FutureTask.java:274) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627) at com.pega.dsm.dnode.impl.prpc.PrpcThreadFactory$PrpcThread.run(PrpcThreadFactory.java:81) Caused by: com.pega.dsm.dnode.impl.core.ExceptionWithInputRecord: java.lang.NullPointerException at com.pega.dsm.dnode.api.dataflow.DataFlowStage$StageInputSubscriber.onNext(DataFlowStage.java:261) at com.pega.dsm.dnode.api.dataflow.DataFlowStage$StageInputSubscriber.onNext(DataFlowStage.java:184) at com.pega.dsm.dnode.api.dataflow.DataFlowExecutor$QueueBasedDataFlowExecutor$2.process(DataFlowExecutor.java:190) ... 11 more Caused by: java.lang.NullPointerException at com.pegarules.generated.activity.ra_action_invoke_7b7e26e3210d404a258d75fab7c2fcac.step2_circum0(ra_action_invoke_7b7e26e3210d404a258d75fab7c2fcac.java:259) at com.pegarules.generated.activity.ra_action_invoke_7b7e26e3210d404a258d75fab7c2fcac.perform(ra_action_invoke_7b7e26e3210d404a258d75fab7c2fcac.java:86) at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3505) at com.pegarules.generated.activity.ra_action_writetofile_a80390755d67cf1ba463180245558d87.step3_circum0(ra_action_writetofile_a80390755d67cf1ba463180245558d87.java:272) at com.pegarules.generated.activity.ra_action_writetofile_a80390755d67cf1ba463180245558d87.perform(ra_action_writetofile_a80390755d67cf1ba463180245558d87.java:87) at

Steps to Reproduce



1. Create DDF.
2.  Read from Report Def, write to a file via Activity:Connect-File.
3. Create a Connect-File rule.
4. Call the rule in an activity.
5. Run the DDF.

Root Cause



The version of Invoke activity in the Pega Marketing ruleset is sync-ed up with the later version of PRPC and added additional null checks so that it work in the context of non Pega Marketing and Pega Marketing calls to connect-file methods.

Resolution



As a local change, alter the activity call, do the following: 

1. Create a page called "OverRidePage" of class Embed-Template-FileConfig. 
2. Create empty properties FileName and FilePath on this page. 
3. Call the Connect-File method using OverRidePage as the step page. 

Published November 28, 2016 - Updated December 7, 2016

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.