Question
Pegasystems Inc.
AU
Last activity: 8 Oct 2015 20:09 EDT
String Array in REST Connector Request Data (POST)
Using the REST Connector Wizard, for a post operation, the below string is incorrectly rejected as invalid JSON for the request data (it should be noted, this is the sum total of the request data).
["Valid","JSON","Array"]
I've attempted to use both a pagelist of SingleValue-Text and ValueList as a source for the MapFrom in the Connect-REST with no success.
Any thoughts as to how or whether Pega (7.1.8) supports this?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Please confirm my understanding - Your external Rest service is expecting the client, Pega in this case, to send in the JSON object of the format ["Valid","JSON","Array"] but you have been unable to use pagelist or singlevalue-text fields under Methods tab of Connect-REST rule to Map this value From.
Can you provide the full exception stack you are seeing?
Pegasystems Inc.
AU
Morning Aditya,
Stack trace as below, in using the pagelist and valuelist the stacktrace only varies in the message, both listed.
com.pega.pegarules.pub.services.OutboundMappingException: Attempting to map data from page list property .Request_Post to unsupported data type: String
com.pega.pegarules.pub.services.OutboundMappingException: Attempting to map data from string list property .Request_Post to unsupported data type: String
Morning Aditya,
Stack trace as below, in using the pagelist and valuelist the stacktrace only varies in the message, both listed.
com.pega.pegarules.pub.services.OutboundMappingException: Attempting to map data from page list property .Request_Post to unsupported data type: String
com.pega.pegarules.pub.services.OutboundMappingException: Attempting to map data from string list property .Request_Post to unsupported data type: String
at com.pega.pegarules.integration.engine.internal.util.PRServiceUtils.mapOutboundData(PRServiceUtils.java:1308) at com.pegarules.generated.activity.ra_action_invoke_6a91441c4f6e5048b63360383ae1b952.step5_circum0(ra_action_invoke_6a91441c4f6e5048b63360383ae1b952.java:693) at com.pegarules.generated.activity.ra_action_invoke_6a91441c4f6e5048b63360383ae1b952.perform(ra_action_invoke_6a91441c4f6e5048b63360383ae1b952.java:137) at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3500) at com.pegarules.generated.activity.ra_action_pxcallconnector_11f2ec27fb0b16bb79951eb7d74cbe15.step10_circum0(ra_action_pxcallconnector_11f2ec27fb0b16bb79951eb7d74cbe15.java:1664) at com.pegarules.generated.activity.ra_action_pxcallconnector_11f2ec27fb0b16bb79951eb7d74cbe15.perform(ra_action_pxcallconnector_11f2ec27fb0b16bb79951eb7d74cbe15.java:246) at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3500) at com.pega.pegarules.exec.internal.declare.infengine.pages.DeclarativePageDirectoryImpl.runRule(DeclarativePageDirectoryImpl.java:994) at com.pega.pegarules.exec.internal.declare.infengine.pages.DeclarativePageDirectoryImpl.runLoadActivity(DeclarativePageDirectoryImpl.java:452) at com.pega.pegarules.session.internal.mgmt.base.handler.ReadOnlyDataPageHandler.loadDataPage(ReadOnlyDataPageHandler.java:236) at com.pega.pegarules.session.internal.mgmt.base.handler.ReadOnlyDataPageHandler.findDataPage(ReadOnlyDataPageHandler.java:384) at com.pega.pegarules.session.internal.mgmt.base.AbstractPageDirectory.findDataPageInCurrentDir(AbstractPageDirectory.java:920) at com.pega.pegarules.session.internal.mgmt.base.ThreadPageDir.getDataPageByInsKey(ThreadPageDir.java:737) at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.getDataPageByInsKey(PRThreadImpl.java:2249) at com.pega.pegarules.session.internal.mgmt.Executable.findDataPageByInsKey(Executable.java:10691) at com.pegarules.generated.activity.ra_action_pyrunrecordexecute_8e234b35078998e23dc29ba708a04611.step5_circum0(ra_action_pyrunrecordexecute_8e234b35078998e23dc29ba708a04611.java:523) at com.pegarules.generated.activity.ra_action_pyrunrecordexecute_8e234b35078998e23dc29ba708a04611.perform(ra_action_pyrunrecordexecute_8e234b35078998e23dc29ba708a04611.java:161) at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3500) at com.pega.pegarules.session.internal.mgmt.Executable.invokeActivity(Executable.java:10521) at com.pegarules.generated.activity.ra_action_pzrunrecordexecute_f73998920c112079b42c8cca0a4e44ad.step11_circum0(ra_action_pzrunrecordexecute_f73998920c112079b42c8cca0a4e44ad.java:1009) at com.pegarules.generated.activity.ra_action_pzrunrecordexecute_f73998920c112079b42c8cca0a4e44ad.perform(ra_action_pzrunrecordexecute_f73998920c112079b42c8cca0a4e44ad.java:245) at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3500) at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:646) at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivitiesAlt(PRThreadImpl.java:461) at com.pega.pegarules.session.internal.engineinterface.service.HttpAPI.runActivities(HttpAPI.java:3322) at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequestInner(EngineAPI.java:385) at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1270) at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1008) at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:841) at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequest(EngineAPI.java:331) at com.pega.pegarules.session.internal.engineinterface.service.HttpAPI.invoke(HttpAPI.java:850) at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl._invokeEngine_privact(EngineImpl.java:315) at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:263) at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:240) at com.pega.pegarules.priv.context.JNDIEnvironment.invokeEngineInner(JNDIEnvironment.java:278) at com.pega.pegarules.priv.context.JNDIEnvironment.invokeEngine(JNDIEnvironment.java:223) at com.pega.pegarules.web.impl.WebStandardImpl.makeEtierRequest(WebStandardImpl.java:574) at com.pega.pegarules.web.impl.WebStandardImpl.doPost(WebStandardImpl.java:374) at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethod(PRBootstrap.java:367) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethodPropagatingThrowable(PRBootstrap.java:408) at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingThrowable(AppServerBridgeToPega.java:223) at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethod(AppServerBridgeToPega.java:272) at com.pega.pegarules.internal.web.servlet.WebStandardBoot.doPost(WebStandardBoot.java:121) at com.pega.pegarules.internal.web.servlet.WebStandardBoot.doGet(WebStandardBoot.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) at com.pega.pegarules.integration.engine.internal.ServiceHelper.getOutboundClipboardValue(ServiceHelper.java:3464) at com.pega.pegarules.integration.engine.internal.ServiceHelper.getOutboundDataValue(ServiceHelper.java:2504) at com.pega.pegarules.integration.engine.internal.ServiceHelper.mapOutboundData(ServiceHelper.java:2430) at com.pega.pegarules.integration.engine.internal.util.PRServiceUtils.mapOutboundData(PRServiceUtils.java:1300)
Thanks Joel. So the 'Text' property type works but ValueList and PageList property types don't. The error message seems to suggest that it does expect the format to be String and the Engine doesn't internally do any transformation.
Pegasystems Inc.
AU
It does transformation in instances where you point to a page.
That is, it will happily encode a JSON Object from a page; the issue here is that I am trying to output a JSON array directly from a specific Clipboard Property.
Whilst it is completely valid according to JSON.org to have an ordered list of values not contained in an object, it's looking increasingly likely that Pega only supports JSON Objects.
Pegasystems Inc.
AU
-
Tyler Stubbs Infant Jesus Bukhari Saheb Shaik