My Oracle Support Banner

Java PX Error During File Upload Is Not Displayed in Web Client (Doc ID 2130367.1)

Last updated on FEBRUARY 19, 2017

Applies to:

Oracle Agile PLM Framework - Version 9.3.3.0 to 9.3.5.0 [Release 9.3]
Information in this document applies to any platform.

Symptoms

Actual Behavior
When uploading attachment files through Web Client Attachment tab with "Update Table" Event Type, and the Java PX ends in error, the custom error message which is coded in PX java file is not displayed in the Web Client UI.

Custom error message is displayed on History tab.

When checkin file from Web Client Attachment tab with the "Check In Files" Event Type, and the Java PX ends in error, the custom error message which is coded in PX java file is displayed in the Web Client UI.

Expected Behavior
When upload attachment files through Web Client Attachment tab with the "Update Table " Event Type, and the Java PX ends in error, the custom error message which is coded in PX java file is displayed in the Web Client UI.

Steps

For File Upload process

  1. Create a JAR file including the following java code.
    package agile.sample.event.item;

    import com.agile.api.IAgileSession;
    import com.agile.api.INode;
    import com.agile.px.ActionResult;
    import com.agile.px.EventActionResult;
    import com.agile.px.IEventAction;
    import com.agile.px.IEventInfo;

    public class ItemUpdateAttachmentTablePreHandler implements IEventAction {

       @Override
       public EventActionResult doAction(IAgileSession session, INode node, IEventInfo eventInfo) {
           ActionResult result = new ActionResult(ActionResult.EXCEPTION, newException("File attachment error!"));
           return new EventActionResult(eventInfo, result);
       }
    }
      

  2. Add the jar file created in step1 to the following directory.

    /home/oracle/agile/agile933/integration/sdk/extensions

  3. Login to Java Client with admin user and setup the following Event/Event Handlers/Event Subscribers

    Event
    ---------
    Event Type : Update Table
    Name :  Item_UpdateAttachmentTable
    API Name :  Item_UpdateAttachmentTable
    Object Type : Items
    Table Name : Attachments

    Event Handlers
    ----------------
    Name : ItemUpdateAttachmentTablePreSampleHandler
    API Name : ItemUpdateAttachmentTablePreSampleHandler
    Role : null
    Enabled : Yes
    Event Action : agile.sample.event.item.ItemUpdateAttachmentTablePreHandler

    Event Subscribers
    ------------------
    Name : Item_UpdateAttachmentTablePreSampleEvent
    API name : Item_UpdateAttachmentTablePreSampleEvent
    Enabled :Yes
    Event : Item_UpdateAttachmentTable
    Event Handler : ItemUpdateAttachmentTablePreSampleHandler
    Trigger Type : Pre
    Execution Mode : Synchronous
    Order : 0
    Error Handling Rule : Stop

  4. Login to Web Client
  5. Go to Part object P00026 and move to attachment tab
  6. Press Add button
  7. Upload a file : attachment-07a.txt

    No custom error message appears in the web client UI. The message only appears on history tab.



For File Checkin process

  1. Create a JAR file including the following java code.
    package agile.sample.event.item;

    import com.agile.api.IAgileSession;
    import com.agile.api.INode;
    import com.agile.px.ActionResult;
    import com.agile.px.EventActionResult;
    import com.agile.px.IEventAction;
    import com.agile.px.IEventInfo;

    public class ItemCheckInFilePreHandler implements IEventAction {

       @Override
       public EventActionResult doAction(IAgileSession session, INode node, IEventInfo eventInfo) {
           ActionResult result = new ActionResult(ActionResult.EXCEPTION, newException("Check in file error!"));
           return new EventActionResult(eventInfo, result);
       }

    }
      

  2. Add the jar file created in step1 to the following directory.

    /home/oracle/agile/agile933/integration/sdk/extensions

  3. Login to Java Client with admin user and setup the following Event/Event Handlers/Event Subscribers

    Event
    --------
    Event Type : Check In Files
    Name : Part - Checkin Files Event2
    API Name : PartCheckinFilesEvent2
    Enabled : Yes
    Object Type : Items

    Event Handler
    ------------
    Handler Type : Java PX
    Name : CheckIn Files Pre Sample EventHandler2
    API Name : CheckInFilesPreSampleEventHandler2
    Enabled : Yes
    Event Action : agile.sample.event.item.ItemCheckinFilePreHandler

    Event Subscribers
    --------------------
    Name : Part CheckIn Files PreEvent2
    API Name : PartCheckInFilesPreEvent2
    Enabled : Yes
    Event : Part - Checkin Files Event2
    Event Type : Check In Files
    Object Type : Items
    Event Handler : CheckIn Files Pre Sample EventHandler
    Handler Type : Java PX
    Trigger Type : Pre
    Execution Mode : Synchronous
    Order : 0
    Error Handling Rule : Stop

  4. Login to Web Client
  5. Go to Part object P00026 and move to attachment tab

    Select

    Filename                                Folder Number
    -----------------------------------------------------
    attachment-09.txt                   FOLDER00090

  6. Checkout
  7. Checkin

    Original File Name    Replace File name
    ------------------------------------------------
    attachment-09.txt     attachment-09a.txt

  8. Press replace

    Error message shows : agile.sample.event.ff.CheckInFilePreHandlerSample on the web client UI

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.