Project and Portfolio Management Practitioners Forum
cancel

Calling a Java class from HP PPM

Highlighted
Tarun Paul
Respected Contributor.

Calling a Java class from HP PPM

Hi,

We have a requirement wherein we need to call a java class file / java program from HPP PPM on an event(on a field change/ request status change etc.).Please provide us the resolution to accomplish this functionality.
Thanks in advance.


Thanks,
Tarun
3 REPLIES
Yevgeniy Demche
Valued Contributor.

Re: Calling a Java class from HP PPM

Hi.
You can use ksc_run_java special command.
Basic steps are:
1) Create java class with your functionality.
2) Export a jar and put it into your PPM server.
3) Create a special command, containing a ksc_run_java step
4) Create an execution step which will invoke your special command.

First step is quite complex, you should extend class BaseCommand which can be found in knta_classes.jar in your server environment. Note that there are binaries, not source. Two basic methods that you should implement are parse() and execute(), first one receives parameter string from ksc_run_java, passed as is, then second will be called.
On second step you should put your jar into server directory, like /(PPM_HOME)/server/(your server)/deploy/itg.war/WEB-INF/lib
Note that you may have to restart your PPM instance.
Then you should create your own special command. Syntax is ksc_run_java your.package.YourClass PARAMETERS. You can create dynamic parameters with tokens.
And then call it from your execution step.
Tarun Paul
Respected Contributor.

Re: Calling a Java class from HP PPM

Thanks for your reply.Can you please provide me with a sample java code(.java) to support your statement. Appreciate your help on this.

Thanks,
Tarun
Yevgeniy Demche
Valued Contributor.

Re: Calling a Java class from HP PPM

Here is an example of java code. I've took a part of working class and ripped all our specific code off.