mrmathison's Profile
Agile Talent
205
Points

Questions
26

Answers
33

  • Agile Talent Asked on February 20, 2021 in Software Development Kit (API).

    I wanted to give an update here, now that I have more or less solved my issue.
    The MultiList03 attribute on the item is configured in our system to use a list.
    And the list it uses is the Agile ‘User Groups’ list, which is considered a dynamic list.
    A simple list is easier to deal with. Let’s say I have a User Group named “Texas”, and another named “Arizona”.
    Below is an example of some code that shows how I can replace the current values, with “Texas” and “Arizona”.
    This is Groovy code added to the code section of an Event Handler within Agile PLM 936.

    // MultiList03 uses the ‘User Groups’ list, which is a dynamic list in Agile, not a simple list
    // item is of the type IItem, which we already defined before getting to this point

    ICell cell = item.getCell(CommonConstants.ATT_PAGE_TWO_MULTILIST03);
    IAgileList values = cell.getAvailableValues();
    if (values.getChildNodes() == null) {
    IAgileClass cls = cell.getAttribute().getListAgileClass();
    obj.logMonitor(“cls: ” + cls); // <– output is — cls: User Groups
    if (cls != null) {

    // *** I plan to have “Texas” and “Arizona” in a String array, so I will do this differently in a loop
    // *** I won’t hard-code these values, because there could be 1 or more. For example: “Texas”, “Ohio”, and “Florida”

    Object[] usrGrps = [ (IUserGroup)session.getObject(cls, “Texas”)]; // <– this will end up being an array of objects
    usrGrps += [ (IUserGroup)session.getObject(cls, “Arizona”)]; // <– the += helped me here

    values.setSelection(usrGrps);
    cell.setValue(values); // <– this worked and added the two values
    }
    }

    • 101 views
    • 1 answers
    • 0 votes
  • Agile Talent Asked on February 19, 2021 in Agile PLM (v9).

    This select has worked for me, but I don’t think it gets the Mfr info.

    v_id NUMBER(10,0) := NULL;
    v_class NUMBER(10,0) := NULL;
    v_parent VARCHAR2(300 BYTE) := NULL;
    v_compo VARCHAR2(300 BYTE) := NULL;
    x_id NUMBER(10,0) := NULL;
    x_class NUMBER(10,0) := NULL;

    — v_id := the id from the item table
    — v_class := the class number from the item table

    — at the bottom of this select, you will see the nth level is set to 7

    SELECT
    f.ITEM_ID AS BOM_ITEM_ID
    , f.item AS PARENT_ID
    , f.component AS COMPONENT_ID
    — f.root_item_id,
    , f.CYCLE
    , f.LVL
    — f.PATH,
    , ( select item_number from AGILE.ITEM g where g.id = f.item ) as PARENT_ITEM_NUMBER
    — , ( select entryvalue from listentry where parentid = 2190144 and langid = 0 and entryid = ( select number from agile_flex where id = f.item and class in ( 9000, 10000 ) and attid = 2198312 )) as XIQ_COMPAT
    — f.latest_released_eco AS PARENT_LATEST_REL_ECO_ID,
    — ( select h.change_number from agile.change h where h.id = f.latest_released_eco ) AS PARENT_ECO_NUMBER,
    — ( select o.rev_number from agile.rev o where o.item = f.item and o.change = ( select o.change from agile.rev o where o.item = f.item and o.latest_flag = 1 and o.released = 1 ) and o.latest_flag = 1 and o.released = 1 ) as parent_latest_rev,
    — ( select o.release_date from agile.rev o where o.item = f.item and o.change = ( select o.change from agile.rev o where o.item = f.item and o.latest_flag = 1 and o.released = 1 ) and o.latest_flag = 1 and o.released = 1 ) as parent_latest_rel_dt,
    — ( select description from AGILE.ITEM g where g.id = f.item ) as PARENT_DESCRIPTION,
    , f.ITEM_NUMBER AS COMPONENT_NUMBER
    , f.FIND_NUMBER
    , f.QUANTITY
    — ( select o.change from agile.rev o where o.item = f.component and o.latest_flag = 1 and o.released = 1 ) as comp_latest_rel_eco_id,
    — ( select h.change_number from agile.change h where h.id = ( select o.change from agile.rev o where o.item = f.component and o.latest_flag = 1 and o.released = 1 ) ) AS comp_latest_eco,
    — ( select o.rev_number from agile.rev o where o.item = f.component and o.latest_flag = 1 and o.released = 1 ) as comp_latest_rev,
    — ( select o.release_date from agile.rev o where o.item = f.component and o.latest_flag = 1 and o.released = 1 ) as comp_latest_rel_dt,
    — ( select description from agile.nodetable where id = ( select release_type from agile.rev where item = f.component and latest_flag = 1 and released = 1 ) and parentid = 1514 ) as comp_lifecycle_phase,
    — ( select class from agile.item where id = f.component ) as COMP_CLASS_ID,
    — ( select subclass from agile.item where id = f.component ) as COMP_SUBCLASS_ID,
    — ( select description from agile.nodetable where id = ( select subclass from agile.item where id = f.component ) ) as COMP_SUBCLASS,
    — ( select category from agile.item where id = f.component ) as COMP_CATEGORY_ID,
    — ( decode(
    — (select class from agile.item where id = f.component),
    — 10000,(select entryvalue from agile.listentry where parentid = 311 and entryid = ( select category from agile.item where id = f.component ) ),
    — 9000,(select entryvalue from agile.listentry where parentid = 321 and entryid = ( select category from agile.item where id = f.component ) )
    — ) ) as COMP_CATEGORY,
    — ( select description from AGILE.ITEM g where g.id = f.component ) as COMPONENT_DESCRIPTION
    , f.notes
    , f.text05
    , f.minimum_number
    , f.maximum_number
    , f.is_mutually_exclusive
    , f.is_optional
    — , ( select entryvalue from agile.listentry where parentid = 2196903 and entryid = f.list01 ) as prim_comp_of_bndl
    , f.text01 — revenue natural acct
    , f.text02 — revenue split percentage
    , f.latest_released_eco
    FROM
    ( SELECT
    e.id AS ITEM_ID
    , e.item
    , e.ITEM_NUMBER
    , e.FIND_NUMBER
    , e.QUANTITY
    , e.component
    , connect_by_root e.COMPONENT as root_item_id
    , CONNECT_BY_ISCYCLE AS CYCLE — “Cycle”
    , level AS LVL
    , SYS_CONNECT_BY_PATH(e.COMPONENT, ‘/’) AS PATH — “PATH”
    , e.notes
    , e.text05
    , e.minimum_number
    , e.maximum_number
    , e.is_mutually_exclusive
    , e.is_optional
    , e.list01
    , e.text01
    , e.text02
    , e.latest_released_eco
    FROM
    ( SELECT
    b.rowid bom_rowid
    , c1.rowid c1_rowid
    , c2.rowid c2_rowid
    , i.rowid i_rowid
    , b.ID
    , b.ITEM
    , b.ITEM_NUMBER
    , b.FIND_NUMBER
    , b.QUANTITY
    , b.DESCRIPTION
    , b.CHANGE_IN
    , b.CHANGE_OUT
    , b.COMPONENT
    , b.CREATED
    , b.LAST_UPD
    , b.notes
    , b.text05
    , b.minimum_number
    , b.maximum_number
    , b.is_mutually_exclusive
    , b.is_optional
    , b.list01
    , b.text01
    , b.text02
    , i.latest_released_eco
    FROM AGILE.BOM b
    , AGILE.CHANGE c1
    , AGILE.CHANGE c2
    , AGILE.ITEM i
    WHERE b.change_in = c1.id(+)
    AND b.change_out = c2.id(+)
    AND (b.change_in=0 OR c1.release_date IS NOT NULL)
    AND (b.change_out=0 OR c2.release_date IS NULL)
    AND i.id = b.item
    AND i.latest_released_eco != 0 ) e
    —- Change level <= 1 if you just want the top level
    CONNECT BY NOCYCLE PRIOR e.COMPONENT = e.ITEM and level <= 7
    START WITH e.ITEM = (select x.id from agile.item x where x.id = v_id AND x.class = v_class)
    ) f;

    • 139 views
    • 2 answers
    • 0 votes
  • Agile Talent Asked on February 11, 2021 in Agile PLM (v9).

    In this Oracle docum, scroll down to section 5.7.3.  But, I have not personally tried it.

    https://docs.oracle.com/cd/E50306_29/otn/pdf/integration/html_agaap/output/chapter_5.htm

     

    • 154 views
    • 1 answers
    • 0 votes
  • Agile Talent Asked on February 3, 2021 in Agile PLM (v9).

    I agree with Raj that the user refresh can happen automatically with LDAP.  I also set up an event that runs once a day and looks for any new users created in Agile, makes them Active and also adds them to a User Group.  I can send you that Groovy script if you wish.  Email me at mathison at hotmail dot com.

    • 219 views
    • 3 answers
    • 0 votes
  • Agile Talent Asked on December 18, 2020 in Product Collaboration.

    Nevermind.  I found an example in the SDK documentation.

    explodeBOM(obj, pitem, 1);
    private static void explodeBOM(IBaseScriptObj obj, IItem item, int level) throws APIException {
    IRow     row;
    String   bomNumber;
    ITable   table = item.getTable(ItemConstants.TABLE_BOM);
    Iterator it    = table.iterator();
        while (it.hasNext()) {
    row = (IRow)it.next();
    bomNumber = (String)row.getValue(ItemConstants.ATT_BOM_ITEM_NUMBER);
    obj.logMonitor(“level: ” + (String)level + ”  part: ” + bomNumber);
    IItem bomItem = (IItem)row.getReferent();
    explodeBOM(obj, bomItem, level + 1);
    }
    return null;
    }
    • 218 views
    • 1 answers
    • 0 votes
  • Agile Talent Asked on December 14, 2019 in Software Development Kit (API).

    Thank you Raj and Kevin.  I added more roles to the Event Handler and then it worked.  And I also needed to change  IAttribute  to  String .  I had found that code somewhere, maybe in one of these forums.  When a user gets created from LDAP, it is automatically giving it the Roles ‘Creator can read and discover object he or she created’ and ‘My User Profile’.  Now, I also want to update the User Category to ‘Concurrent’ and also add the user to a User Group.

    • 563 views
    • 3 answers
    • 0 votes
  • Agile Talent Asked on October 1, 2019 in Other APIs.

    For our Agile system, internally, the dates on the database records are always stored in GMT time zone.  So, if you are in Agile, in US Eastern time, and you save a date and time at 11pm on Sep 30, the value in the database record will say 4am (or 5am) on Oct 1.  GMT is 4 or 5 hours ahead of EST.   Your personal user settings time zone  decide how the date is displayed when you look at it in Agile.

    • 590 views
    • 3 answers
    • 0 votes
  • Agile Talent Asked on May 1, 2019 in Agile PLM (v9).

    I’m not sure if this will help your privilege issue, but I had a question about Groovy, and it is working.  This was my post:  http://myagileplm.com/questions/groovy-script-to-update-an-item/

    This answer accepted by stevend17. on May 1, 2019 Earned 15 points.

    • 862 views
    • 2 answers
    • 0 votes
  • I got it to work with the Import tool by changing the preferences.  

    Your csv file should look like this if you open it with Notepad.  In this example, all 3 parts currently have a subclass of ‘Standard Part’.  I am changing 2 of them to ‘Product ID’ and 1 to ‘Product SKU’.

    PART,PART_TYPE

    5601013-012,Product ID

    5601013-A,Product ID

    5601013-A-E,Product SKU

     

    Using the Import tool, click the Preferences button

    Business Rule

    Smart Rules Warning Violation Behavior: Reject Objects

    Reference Designator Qty Mismatch Behavior: Reject

    Behavior upon non-existing objects: Reject

    Change Mode: Authoring

    Default Types

    Default Item class: Parts

    Default Part type: Product SKU    — this may not be necessary to change, but it worked for me

     

    Hit Save to save the preferences.   Hit Next.   Choose Item only.   Hit Next.

     

    Data Mapping:     ( o )  Define attribute mapping in next step

    Data Transformation:    ( o )  No transformations are necessary

    Redline Options:    ( o )  Updates do not require redlining

     

    Hit Next.

    For the mapping

    Part       –>  Parts > Title Block > Number

    Part_Type  –>  Parts > Title Block > Part Type

     

    Hit Next and then Import

    • 721 views
    • 6 answers
    • 0 votes
  • Keep in mind that once I hit that Import button, every attribute on Page Three will be wiped out and deleted for each of those parts being updated.  So, I am going to extract the PAGE_THREE table for these parts first and save to a file before I do the Import.

    • 721 views
    • 6 answers
    • 0 votes