Creating an Agile PLM Process Extension   Agile Process Extensions           (Agile PX)
Introduction/Background In my last blog article, Process Extension Development  – Demoting a Change Order, I offered some...
Creating the Process Extension (PX) A process extension is really nothing more than a Java archive file, or JAR  file. He...
Creating the Process Extension (PX)                                       (cont) META-INF/services/com.agile.px.ICustomAc...
Deploying the Process Extension onthe Agile ServerThe next step in this extension’s journey is to be copied on thefile sys...
Adding the Process Extension (PX) toAgile PLMTo add the process extension to Agile PLM1.    Launch the Java Client: http:/...
Step 5 – Creating the PX
Step 12 – Workflow Definition
ConclusionYour extension is now set up in Agile. It is veryeasy to deploy custom process extensionsallowing you to customi...
About Us PLM Mechanic specializes in the technical  aspects of Oracle’s Agile PLM solution We offer the following servic...
Contact Us   Web: http://www.plmmechanic.com   Blog: http://www.plmmechanic.com/blog   Email: sales@plmmechanic.com   ...
Upcoming SlideShare
Loading in...5
×

Agile PX - Creating an Agile PLM Process Extension

1,817

Published on

In my last blog article, Process Extension Development – Demoting a Change Order, I offered some source code that demotes a change order when one of the affected items on the change has an obsolete item on its BOM. There were a few follow up posts in the LinkedIn discussion about how to create a process extension, also called a PX. This blog will help outline the steps to package the source code, create the ICustomAction and configure Agile PLM to trigger the process extension (PX) on the submitted workflow step.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,817
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • Title: Agile Process Extensions - (Agile PX)Subtitle: Creating an Agile PLM Process Extension
  • Introduction/BackgroundIn my last blog article, Process Extension Development – Demoting a Change Order, I offered some source code that demotes a change order when one of the affected items on the change has an obsolete item on its BOM.  There were a few follow up posts in the LinkedIn discussion about how to create a process extension, also called a PX.  This blog will help outline the steps to package the source code, create the ICustomAction and configure Agile PLM to trigger the process extension (PX) on the submitted workflow step.
  • Creating the Process Extension (PX)A process extension is really nothing more than a Java archive file, or JAR file.   Here is the internal structure of the file:+---com¦   +---vestalsgap¦           AbstractPX.class¦           EcoDemoter.class+---META-INF    +---services            com.agile.px.ICustomActionNow that we have a sample structure, we can inspect all of the paths and files that make it up.
  • Creating the Process Extension (PX) (cont)META-INF/services/com.agile.px.ICustomAction - Process extensions are required to have a com.agile.px.ICustomAction file. This file contains the name of the PX classes in the JAR that are eligible to provide actions inside of Agile. Later you will see why this file is so important. In our example above, the file would contain com.vestalsgap.EcoDemoter. It is not necessary to use the .class extension but it is important to make sure the class package name is correctcom/vestalsgap/*.class – These are the Java classes that give my process extension its functionality. I typically use (and reuse) the same Abstract class that can pull from configuration files and provide logging capability. The file mentioned in the ICustomAction does need to inherit or implement the doAction method!With the JAR file complete, we are ready to deploy it.
  • Deploying the Process Extension on the Agile ServerThe next step in this extension’s journey is to be copied on the file system of the Agile PLM application server.  Copy the extension to AGILE_HOME/Agile931/integration/sdk/extensionsWith the JAR file deployed in the extensions directory, we are now ready to configure Agile PLM.
  • Adding the Process Extension (PX) to Agile PLMTo add the process extension to Agile PLMLaunch the Java Client: http://server:port/JavaClient/start.htmlLog in as an administratorNavigate to Admin Tab | Settings | Data Settings | Process ExtensionsClick NewFill out the popup form.Click OKAn edit screen will appear with all of your values in it, click closeNext go to the workflow you would like to edit and open itClick the status tabHighlight the workflow step you would like to add the extension onDouble click the desired row of the criteria section of the screenSelect the process extensionClick save
  • Source Code for the process extensionpackage com.vestalsgap.px;import com.agile.api.*;import com.agile.px.ActionResult;import java.util.*;import org.apache.log4j.Logger;public class EcoDemoter extends AbstractPX { /* * Process Extension Functionality * * Configure a Process Extension which can run on workflow change status to get Items on * Change Order and check all of its BOM for Obselete part if its failing, Dont release the * Change Order. * */ // consider a history message that mentions the actual affected items that are in violation // and a format string read from configuration rather than hard coded - this is only an example String history = "The change order was demoted because the BOM of one or more affected items contained an obsolete item"; // again this should be a configuration setting String invalidLifecycles = ",Obsolete,"; public ActionResultdoAction(IAgileSession session, INodeactionNode, IDataObjectaffectedObject) { // only process change ordersActionResult outcome = new ActionResult(); if ( !(affectedObjectinstanceofIChange) ) return outcome; IChange change = (IChange) affectedObject; try {ITableaffectedItems = change.getTable(ChangeConstants.TABLE_AFFECTEDITEMS); Iterator<IRow> rows = affectedItems.iterator();IRow row;IItemaffectedItem = null; while(rows.hasNext()) { // get the affected item row = (IRow) (rows.next());affectedItem = (IItem) row.getReferent(); if ( !hasValidBOM(affectedItem) ) { outcome = new ActionResult(ActionResult.STRING, history); demote(change, history); break; } } return outcome; } catch (Throwableth) {logger.error("Error: " + th.getMessage()); return new ActionResult(ActionResult.EXCEPTION, th); } } private void demote(IChange change, String reason) throws Exception {IStatus[] states = change.getWorkflow().getStates();IStatus status = change.getStatus(); // a change cannot be demoted if it is already at the beginning of the workflow if (states[0] == status) { logger.info(change.getName() + " is already at the first workflow step ... cannot demote."); return; } for (inti=0; i<states.length; i++) { if (states[i] == status && i>0) { status = states[i-1]; break; } } Object[] approvers = change.getApproversEx(status); Object[] observers = change.getObserversEx(status);change.changeStatus(status, false, reason, true, false, new IUser[0], approvers, observers, false); } private booleanhasValidBOM(IItem parent) throws Exception {ITable items = parent.getTable(ItemConstants.TABLE_BOM); Iterator<IRow> rows = items.iterator();IRow row; String lifecycle = "";IItem item; while(rows.hasNext()) { row = rows.next(); // This should be a configuration parameter to check against a list of phases lifecycle = row.getReferent().getValue(ItemConstants.ATT_TITLE_BLOCK_LIFECYCLE_PHASE).toString(); if (lifecycle != null && invalidLifecycles.indexOf(lifecycle) > -1) return false; } return true; }}
  • ConclusionYour extension is now set up in Agile.  It is very easy to deploy custom process extensions allowing you to customize your Agile PLM installation so that it will adapt to your business needs!
  • About UsPLM Mechanic specializes in the technical aspects of Oracle’s Agile PLM solutionWe offer the following service:Agile PLM installations and upgradesAgile PLM maintenance and help desk functionsAgile PLM hostingCustomizationPLM Mechanic also has several product offerings
  • Contact UsWeb: http://www.plmmechanic.comBlog: http://www.plmmechanic.com/blogEmail: sales@plmmechanic.comPhone: 512-827-2262 Fax: 512-582-2932
  • Agile PX - Creating an Agile PLM Process Extension

    1. 1. Creating an Agile PLM Process Extension Agile Process Extensions (Agile PX)
    2. 2. Introduction/Background In my last blog article, Process Extension Development – Demoting a Change Order, I offered some source code that demotes a change order when one of the affected items on the change has an obsolete item on its BOM There were a few follow up posts in the LinkedIn discussion about how to create a process extension, also called a PX. This will help outline the steps to package the source code, create the ICustomAction and configure Agile PLM to trigger the process extension (PX) on the submitted workflow step.
    3. 3. Creating the Process Extension (PX) A process extension is really nothing more than a Java archive file, or JAR file. Here is the internal structure of the file: +---com ¦ +---vestalsgap ¦ AbstractPX.class ¦ EcoDemoter.class +---META-INF +---services com.agile.px.ICustomAction Now that we have a sample structure, we can inspect all of the paths and files that make it up.
    4. 4. Creating the Process Extension (PX) (cont) META-INF/services/com.agile.px.ICustomAction - Process extensions are required to have a com.agile.px.ICustomAction file. This file contains the name of the PX classes in the JAR that are eligible to provide actions inside of Agile. Later you will see why this file is so important. In our example above, the file would contain com.vestalsgap.EcoDemoter. It is not necessary to use the .class extension but it is important to make sure the class package name is correct com/vestalsgap/*.class – These are the Java classes that give my process extension its functionality. I typically use (and reuse) the same Abstract class that can pull from configuration files and provide logging capability. The file mentioned in the ICustomAction does need to inherit or implement the doAction method! With the JAR file complete, we are ready to deploy it.
    5. 5. Deploying the Process Extension onthe Agile ServerThe next step in this extension’s journey is to be copied on thefile system of the Agile PLM application server. Copy theextension to AGILE_HOME/Agile931/integration/sdk/extensions
    6. 6. Adding the Process Extension (PX) toAgile PLMTo add the process extension to Agile PLM1. Launch the Java Client: http://server:port/JavaClient/start.html2. Log in as an administrator3. Navigate to Admin Tab | Settings | Data Settings | Process Extensions4. Click New5. Fill out the popup form.6. Click OK7. An edit screen will appear with all of your values in it, click close8. Next go to the workflow you would like to edit and open it9. Click the status tab10. Highlight the workflow step you would like to add the extension on11. Double click the desired row of the criteria section of the screen12. Select the process extension13. Click save
    7. 7. Step 5 – Creating the PX
    8. 8. Step 12 – Workflow Definition
    9. 9. ConclusionYour extension is now set up in Agile. It is veryeasy to deploy custom process extensionsallowing you to customize your Agile PLMinstallation so that it will adapt to your businessneeds!
    10. 10. About Us PLM Mechanic specializes in the technical aspects of Oracle’s Agile PLM solution We offer the following service: – Agile PLM installations and upgrades – Agile PLM maintenance and help desk functions – Agile PLM hosting – Customization PLM Mechanic also has several product offerings
    11. 11. Contact Us Web: http://www.plmmechanic.com Blog: http://www.plmmechanic.com/blog Email: sales@plmmechanic.com Phone: 512-827-2262 Fax: 512-582-2932

    ×