SlideShare a Scribd company logo
1 of 12
Agile Process Extensions
        (Agile PX)
     Demoting a Change Order
Introduction/Background
 I was reviewing the Agile PLM SDK group in LinkedIn
 Someone was having an issue with obsolete parts
  showing on the BOM of an item on a change order
 The issue is not that parts on the change were
  obsolete, it is that parts on the BOM of the affected
  items of a change were obsolete
 A process extension (PX) was proposed by another
  group member to remedy this business rule
 This presentation illustrates the implementation of that
  process extension.
Agile PLM Change Order
Agile PLM Change Order containing part 140002 (not obsolete) and its BOM.
Agile PLM Part
Here is the title page of the item (140001) that was on the BOM of the
affected item (140002)
Problem Decomposition
Here is the functional decomposition of what needs to happen in the Agile
PLM process extension (PX) to get the desired results:

   Pull the affected items table for the change order passed into the process
    extension
      – For each item on the change
           • Get the underlying Agile item from the referenced affected item
                – Get the BOM of the affected item
                     » Look at the title page lifecycle attribute for each item on the
                        BOM
           • If we find an obsolete part, we need to demote
   If we need to demote
      – Get the workflow status’
      – Make sure we are not at the beginning of the workflow – if we are, do nothing
      – Demote to the prior workflow state and add a history item
End Results
Here is the aftermath the process extension fires
Source Code                                               (page 1)


package 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 ActionResult doAction(IAgileSession session, INode actionNode, IDataObject affectedObject) {
    // only process change orders
    ActionResult outcome = new ActionResult();

    if ( !(affectedObject instanceof IChange) ) return outcome;

    IChange change = (IChange) affectedObject;
Source Code                                               (page 2)



try {
        ITable affectedItems = change.getTable(ChangeConstants.TABLE_AFFECTEDITEMS);
        Iterator<IRow> rows = affectedItems.iterator();
        IRow row;
        IItem affectedItem = 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 (Throwable th) {
         logger.error("Error: " + th.getMessage());
         return new ActionResult(ActionResult.EXCEPTION, th);
      }
  }
Source Code                                                 (page 3)



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 (int i=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);
 }
Source Code                                                 (page 4)



private boolean hasValidBOM(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;
    }
}
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
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

More Related Content

Recently uploaded

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Recently uploaded (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Agile PX - Demoting a Change Order

  • 1. Agile Process Extensions (Agile PX) Demoting a Change Order
  • 2. Introduction/Background  I was reviewing the Agile PLM SDK group in LinkedIn  Someone was having an issue with obsolete parts showing on the BOM of an item on a change order  The issue is not that parts on the change were obsolete, it is that parts on the BOM of the affected items of a change were obsolete  A process extension (PX) was proposed by another group member to remedy this business rule  This presentation illustrates the implementation of that process extension.
  • 3. Agile PLM Change Order Agile PLM Change Order containing part 140002 (not obsolete) and its BOM.
  • 4. Agile PLM Part Here is the title page of the item (140001) that was on the BOM of the affected item (140002)
  • 5. Problem Decomposition Here is the functional decomposition of what needs to happen in the Agile PLM process extension (PX) to get the desired results:  Pull the affected items table for the change order passed into the process extension – For each item on the change • Get the underlying Agile item from the referenced affected item – Get the BOM of the affected item » Look at the title page lifecycle attribute for each item on the BOM • If we find an obsolete part, we need to demote  If we need to demote – Get the workflow status’ – Make sure we are not at the beginning of the workflow – if we are, do nothing – Demote to the prior workflow state and add a history item
  • 6. End Results Here is the aftermath the process extension fires
  • 7. Source Code (page 1) package 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 ActionResult doAction(IAgileSession session, INode actionNode, IDataObject affectedObject) { // only process change orders ActionResult outcome = new ActionResult(); if ( !(affectedObject instanceof IChange) ) return outcome; IChange change = (IChange) affectedObject;
  • 8. Source Code (page 2) try { ITable affectedItems = change.getTable(ChangeConstants.TABLE_AFFECTEDITEMS); Iterator<IRow> rows = affectedItems.iterator(); IRow row; IItem affectedItem = 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 (Throwable th) { logger.error("Error: " + th.getMessage()); return new ActionResult(ActionResult.EXCEPTION, th); } }
  • 9. Source Code (page 3) 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 (int i=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); }
  • 10. Source Code (page 4) private boolean hasValidBOM(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; } }
  • 11. 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
  • 12. 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

Editor's Notes

  1. Title: Agile Process Extensions - (Agile PX)Subtitle: Demoting a Change Order
  2. Introduction/BackgroundI was reviewing the Agile PLM SDK group in LinkedInSomeone was having an issue with obsolete parts showing on the BOM of an item on a change orderThe issue is not that parts on the change were obsolete, it is that parts on the BOM of the affected items of a change were obsoleteA process extension (PX) was proposed by another group member to remedy this business ruleThis presentation illustrates the implementation of that process extension.
  3. This is a picture of the Agile PLM Change Order containing part 140002 (not obsolete) and its BOM.
  4. Here is a picture of the title page of the item (140001) that was on the BOM of the affected item (140002)
  5. Here is the functional decomposition of what needs to happen in the Agile PLM process extension (PX) to get the desired results:Pull the affected items table for the change order passed into the process extensionFor each item on the changeGet the underlying Agile item from the referenced affected itemGet the BOM of the affected itemLook at the title page lifecycle attribute for each item on the BOMIf we find an obsolete part, we need to demoteIf we need to demoteGet the workflow status’Make sure we are not at the beginning of the workflow – if we are, do nothingDemote to the prior workflow state and add a history item
  6. Here is the aftermath the process extension fires
  7. 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 = &quot;The change order was demoted because the BOM of one or more affected items contained an obsolete item&quot;; // again this should be a configuration setting String invalidLifecycles = &quot;,Obsolete,&quot;; 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&lt;IRow&gt; 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(&quot;Error: &quot; + 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() + &quot; is already at the first workflow step ... cannot demote.&quot;); return; } for (inti=0; i&lt;states.length; i++) { if (states[i] == status &amp;&amp; i&gt;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&lt;IRow&gt; rows = items.iterator();IRow row; String lifecycle = &quot;&quot;;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 &amp;&amp; invalidLifecycles.indexOf(lifecycle) &gt; -1) return false; } return true; }}
  8. 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
  9. Contact UsWeb: http://www.plmmechanic.comBlog: http://www.plmmechanic.com/blogEmail: sales@plmmechanic.comPhone: 512-827-2262 Fax: 512-582-2932