Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

How to input the arguments for Invoke External JAR

alc
Regular Contributor
Regular Contributor

Hello Saviynt Expert,

When create a new job to invoke ExternalJARJob, It ask for 3 parameters:

1. full class name with package name,

2. method name

3. argument in Json format

I know how to set first two parameters, but don't understand how to set third parameter in Json format.

For instance, if I have a following class with a method, how should I create the job with a correct argument value? I tried {"arg":"test"} which in in Json format, but the job is failed to execute. any idea please?

package com.external.custom;

public class CustomClazz {

    public CustomClazz() {}

    public void printArgument(String arg) {
        System.out.println("Your input is: " + arg);
    }

}

 

7 REPLIES 7

rushikeshvartak
All-Star
All-Star

Your java code should take input in json format


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

alc
Regular Contributor
Regular Contributor

Hello Rushikesh, Thank you very much always answer my question.

Does it looks like below to take JSONObject as argument? if not, could you please give me an example, very simple one is fine.

    public void printArgument(JSONObject jsonArg) {
        System.out.println("Your input is: " + jsonArg.toString());
    }

 

Go through code provided by saviynt for sftp (code and jar is attached in end of page)

https://docs.saviyntcloud.com/bundle/AS400-Guide/

 

Use public static String createAccount(Map<String,String> arg) { }

https://docs.saviyntcloud.com/bundle/JAR-v2020x/page/Content/Understanding-the-JAR-Package-Framework...

**edited by moderator to update URLs**

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

alc
Regular Contributor
Regular Contributor

Hello Rushikesh,

Thank you very much for your help! It works!

Best regards,

cdasari
New Contributor
New Contributor

Hello RUshikesh,

I'm looking for similar implementation, the link to the documentation takes to the new portal. Can you provide the reference to the jar code you mentioned.

Thank You!

Dave
Community Manager
Community Manager

Hi @cdasari -

You can try these links on the new docs portal:

https://docs.saviyntcloud.com/bundle/AS400-Guide/

https://docs.saviyntcloud.com/bundle/JAR-v2020x/page/Content/Understanding-the-JAR-Package-Framework...

If they don't have the answers you are looking for, it will be best to post a new topic with your question.

Best reagrds,
Dave

cdasari
New Contributor
New Contributor

Thank You!