SecurID® Governance & Lifecycle Blog

Subscribe to the official SecurID Governance & Lifecycle community blog for information about new product features, industry insights, best practices, and more.

Steps to compile and deploy java node class in weblogic

ChitraAnilkumar
Moderator Moderator
Moderator
2 8 2,235

test.png

  1. Copy the aveksa.ear to localbox
  2. Explode the ear.
  3. Use the server.jar from exploded ear to compile the class:

Javac –classpath ./server.jar TestJavaNode.java

  4. Copy the class file to the following path in the exploded ear:

/aveksa.war/WEB-INF/plug-ins/JavaNode/classes

      If it’s a jar file, copy it to

/aveksa.war/WEB-INF/plug-ins/JavaNode/lib

  5. Repackage the ear

  6. Update and deploy the ear on weblogic server

Capture.PNG

8 Comments
YogeshMishra
Occasional Contributor
Occasional Contributor

Hi Anil,

 

I have below queries:

where to keep TestJavaNode.java

Do we need to include import com.aveksa.x.x etc

Do we require public static void main statement or just method

 

please share if you have detailed steps.

 

 

Thanks

Yogesh Mishra 

ChitraAnilkumar
Moderator Moderator
Moderator

Since you are exploding the ear on your localbox and using that to compile your java node class, you could keep that on your localbox too and specify that path during compilation at step 3.

 

The WorkflowContext class import is mandatory. The other imports depend on what you want to use in your java class.

 

main() is not required, just that one method in the particular format – public boolean (WorkflowContext ctx) {}. You could add additional methods in the same format if you want to call them from the workflow or private methods for internal logic.

 

Hope this helps.

 

Thanks,

Chitra Anilkumar,

Mobile: 248-756-2283.

 

Upcoming vacation time – 2/20

Dell EMC Holidays –5/29

{}

YogeshMishra
Occasional Contributor
Occasional Contributor

Thanks Chitra for info.

Do we have any detailed document for the same which I can follow.

 

Regards

Yogesh Mishra

ChitraAnilkumar
Moderator Moderator
Moderator

Other than the product documentation, i don't have anything else.

AnupShekhar
Contributor
Contributor

Hi Chitra,

Is there any way to pass on change request name or change request ID to the java class.

Thank You,

Anup

PradeepKadambar
Moderator Moderator
Moderator

I suggest looking at the sample packaged within the EAR file for Java node before you start building a Java node.

 

The framework will pass all the necessary details to the Java Node

public boolean method1(WorkflowContext ctx) {
        boolean ret = false;

        // Get some information about the change request associated with the workflow
        try {
            ChangeRequest cr = ctx.getRequest(true);
            if (cr != null) {
                String desc  = cr.getDescription();
                String reqID = cr.getgetRequestID();
                String reqName = cr.getName();
                ..............................
                ..............................
                ..............................
            }
        } catch (PersistenceException pex) {
             logger.error("Error finding the associated change request", pex);
        }
        return ret;
    }
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

The sample also has information about setting a workflow variable etc.

ChitraAnilkumar
Moderator Moderator
Moderator

Hi Anup,

 

You can find an example of a java node @ /home/oracle/wildfly-8.2.0.Final/standalone/tmp/vfs/deployment/deploymenta<>/aveksa.war-<>/WEB-INF/plug-ins/JavaNode/src/com/aveksa/samples/workflow.

You can access the CR id and name with following method calls:

 

(ChangeRequest)cr.getRequestID()

(ChangeRequest)cr.getName ()

 

 

Hope this helps.

 

Regards,

Chitra.

AnupShekhar
Contributor
Contributor

Hi Chitra,

 

Thank you for the information.

 

Thank You,

Anup Shekhar

Sr. Information Security Engineer

 

 

 

MUFG Union Bank, N.A.

Harborside 3

210 Hudson Street, Suite 500

Jersey City, NJ 07311

 

A member of MUFG, a global financial group