Monday, September 4, 2017
On September 04, 2017 by Kamlesh No comments
Creating My First Process Extension
while developing PX for Agile PLM, the most important part is project structure.
- Create a Java Project in Eclipse
- Under source folder add META-INF folder
- Create services folder under META-INF
- Create com.agile.px.ICustomAction file in services folder
So the project structure should be like :
Project
=>src
=>com.first.px
=>HelloWorld.java
=>META-INF
=>services
=>com.agile.px.ICustomAction
=>src
=>com.first.px
=>HelloWorld.java
=>META-INF
=>services
=>com.agile.px.ICustomAction
What does com.agile.px.ICustomAction:
This file contains the full name of the PX class, when we say full name it means name of the class along with package. In our case this file will contain
com.first.px.HelloWorld
Note: In this file we dont need to specify .class or .java extension
Why this structure:
This structure is important because when we deploy our jar in extensions folder, Agile PLM reads the structure and gets the PX class name from META-INF->services->com.agile.px.ICustomAction file. If we miss this structure PX framework will not be able to read it.
Code:
Every PX needs to implement ICustomAction Interface in order to recognized as PX in Agile PLM. The only method that needs to override/impelent is doAction. This method will provide our process extension following from PX framework.
- Session
- node
- IDataObject which is current business object like Part, Document, change etc
here is a demo code that can be used to create a hello world PX
package com.first.px;
import com.agile.api.APIException;
import com.agile.api.IAgileSession;
import com.agile.api.IDataObject;
import com.agile.api.INode;
import com.agile.px.ActionResult;
import com.agile.px.ICustomAction;
import com.agile.api.IAgileSession;
import com.agile.api.IDataObject;
import com.agile.api.INode;
import com.agile.px.ActionResult;
import com.agile.px.ICustomAction;
public class HelloWorld implements ICustomAction {
@Override
public ActionResult doAction(IAgileSession session, INode arg1,IDataObject object) {
String objectName="";
try {
objectName= object.getName();
} catch (APIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// TODO Auto-generated method stub
return new ActionResult(ActionResult.STRING, objectName);
}
public ActionResult doAction(IAgileSession session, INode arg1,IDataObject object) {
String objectName="";
try {
objectName= object.getName();
} catch (APIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// TODO Auto-generated method stub
return new ActionResult(ActionResult.STRING, objectName);
}
}
Note: Please add AgileAPI.jar in your project class path in order to compile your PX.
Subscribe to:
Post Comments (Atom)
Search
AdSense
Recent Posts
Popular Posts
-
WLST Script for checking the health status of Weblogic Domain (Admin/Managed node) After long time writing something about WLST WLST...
-
WLST Script for checking the status of JDBC Datasource in Weblogic WLST has some good features like we can monitor the weblogic dom...
-
WLST Script for Monitoring the JMS status of Weblogic Domain After long time writing something about WLST WLST has some good feature...
-
WLST Server Start The server of a WebLogic domain can be started using different techniques. The best setup depends on the technical re...
-
How to Deploy Application using WLST We can use WLST to quickly deploy an Application in a Weblogic Server. Requirement:- · The ...
-
How to create WebLogic Domain using Domain template: 1. Open an existing domain template (assuming WebLogic Server is installed at c:...
-
Basic concepts of WLST. What is WLST? It is a scripting tool offered by Weblogic. Any way WLST is not only for a sense of control,...
-
Hi All, writing something about OPMN utility with oracle instance and Weblogic. WebLogic Server – Weblogic is J2EE application ...
-
Hadoop Distributed Filesystem (HDFS) Built to support high throughput, streaming reads and writes of extremely large files. NAS ...
-
Before diving into this implementation, I would suggest you to look at Spring Security Introduction first. Let's Start Most of the We...
Recent Posts
Sample Text
Blog Archive
Total Pageviews
Find Us On Facebook
Powered by Blogger.
0 comments:
Post a Comment