on 11-15-2008 2:15 AM
Hi All,
I have uploaded the .Jar and all the related files on the server in the folder com/XXXX/Signature.
When I execute using the command(say Java com/XXXX/Signature) I am able to run the program and get the output.
Now I want to use these shell script in a UDF in mapping.
Can somebody help me out on how to use these shell scripts in XI UDFs.
Helpful answers will be rewarded points.
Thanks & Regards,
RK
Hi Rupash
There can be multiple ways to do this. You can create a package of your own and import it to XI and use as a import while creating the UDF. Pass the parameters from UDF to the parent class to execute this.
Another way can be execute the Script from UDF giving complete path of a XI server location.
If you are getting any error let us know.
Check this also for creating XML signature in XI
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Rupash
Check some UDF examples here may be it will help
Give more details is what are the files and how you want to invoke then we can try to help more on this
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
I have the class and everything ready and I have tested it using JCreator and the signature is generated and verified.
Now I am passing a string while testing from JCreator.
I will be passing the same string from XI mapping.
It has to access the class using shell scripts.
I think we need to use the command java com/XYZ/BACK/GenerateSignature from XI server to test it.
Could you please provide me the code to access the shell script commands from UDF?
Thanks & Regards,
RK
Hi Rupash
package com;
import java.io.*;
import java.util.*;
public class ScriptBuilder {
public ScriptBuilder() {
}
public void writeScript() throws java.io.IOException {
Runtime rt = Runtime.getRuntime();
rt.exec("chmod 777 testinglinux.sh");
Process p = rt.exec("./testinglinux.sh");
try {
p.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
String shellfilename = "testing.txt";
if (new File(shellfilename).exists()) {
System.out.println(shellfilename+" File exists");
}
}
public static void main(String[] args) throws java.io.IOException {
ScriptBuilder sb = new ScriptBuilder();
sb.writeScript();
}
}
This is the class where i am executing the shell script. import the package and use as imports and then execute it calling directly package class method. it should call the script.
I didnt have the system right now to test and let you know. Give it a try
Thanks
Gaurav
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.