Question

1
Replies
10913
Views
John Pritchard-Williams (JOHNPW_GCS)
PEGA
Client Support Team Lead
Pegasystems Inc.
GB
JOHNPW_GCS Member since 2009 20 posts
PEGA
Posted: November 11, 2016
Last activity: November 14, 2016
Posted: 11 Nov 2016 5:57 EST
Last activity: 14 Nov 2016 2:23 EST
Closed

Trying to use : tools.getParameterPage().putParamValue( String, Object ) - but seen as putParamValue( String, String ) ?

As a follow-on from this post : https://pdn.pega.com/community/product-support/question/how-create-prpc-page-pxresults-type-page-java-step


I'm trying the following Java Step Code in an Activity on PRPC721 :



try {
 javax.net.ssl.TrustManagerFactory trustManagerFactory = javax.net.ssl.TrustManagerFactory.getInstance(javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm() );
 trustManagerFactory.init((java.security.KeyStore)null);

for (javax.net.ssl.TrustManager trustManager : trustManagerFactory.getTrustManagers() ) {
 javax.net.ssl.X509TrustManager x509TrustManager = (javax.net.ssl.X509TrustManager)trustManager;
 int i = 1;
 for (java.security.cert.X509Certificate cert : x509TrustManager.getAcceptedIssuers()) {
  tools.getParameterPage().putParamValue( "cert", cert );
 oLog.infoForced( i + ":"+cert.getIssuerX500Principal());
 i++;
 }
 }

}
 catch(Exception e) { throw new PRRuntimeException(e); }


But this will not compile; I get:


This record has 1 error(s) in 1 place(s) .



Java at step: 1 line: 9

The method putParamValue(String, String) in the type ParameterPage is not applicable for the arguments (String, X509Certificate)



Compile failed.


The putParamValue ("PublicAPI") has several method signatures, I'm trying to use this one:

Show More

As a follow-on from this post : https://pdn.pega.com/community/product-support/question/how-create-prpc-page-pxresults-type-page-java-step

I'm trying the following Java Step Code in an Activity on PRPC721 :

try {
 javax.net.ssl.TrustManagerFactory trustManagerFactory = javax.net.ssl.TrustManagerFactory.getInstance(javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm() );
 trustManagerFactory.init((java.security.KeyStore)null);

for (javax.net.ssl.TrustManager trustManager : trustManagerFactory.getTrustManagers() ) {
 javax.net.ssl.X509TrustManager x509TrustManager = (javax.net.ssl.X509TrustManager)trustManager;
 int i = 1;
 for (java.security.cert.X509Certificate cert : x509TrustManager.getAcceptedIssuers()) {
  tools.getParameterPage().putParamValue( "cert", cert );
 oLog.infoForced( i + ":"+cert.getIssuerX500Principal());
 i++;
 }
 }

}
 catch(Exception e) { throw new PRRuntimeException(e); }

But this will not compile; I get:

This record has 1 error(s) in 1 place(s) .

Java at step: 1 line: 9
The method putParamValue(String, String) in the type ParameterPage is not applicable for the arguments (String, X509Certificate)

Compile failed.

The putParamValue ("PublicAPI") has several method signatures, I'm trying to use this one:

putParamValue
void putParamValue(java.lang.String aName,
                 java.lang.Object aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.
Parameters:
aName - parameter to receive the specified value
aValue - value to be assigned to the named parameter.

But it seems (I think?) that the compiler is trying to use this one instead ?

void putParamValue(java.lang.String aName,
                 java.lang.String aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.
Parameters:
aName - parameter to receive the specified value
aValue - value to be assigned to the named parameter. An empty String will be used if the value is null.

Is there something I'm doing wrong here ?

(I tried casting my 'X509Certificate' to 'java.lang.Object' into a temporary variable and called with that - but that doesn't seem to help either).

 

 

Show Less
Data Integration Java and Activities
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.