furqantariq1992's Profile
Agile User
37
Points

Questions
7

Answers
6

  • The service returns bytes under the tag ‘content’. SOAP UI will only provide the bytes. For Java just write those bytes to a file

    The following is a sample in C# (not including writing bytes to file system) but essentially will be the same in Java 

    AttachmentService.GetFileAttachmentResponseType response = client.getFileAttachment(request);

    if (response.statusCode == AttachmentService.ResponseStatusCode.SUCCESS)
    {
    AttachmentService.AgileGetFileAttachmentResponse[] responses = response.responses;
    foreach (AttachmentService.AgileGetFileAttachmentResponse resp in responses)
    {
    AttachmentService.AgileFileAttachmentResponseType[] attachments = resp.attachment;
    if (attachments != null)
    {
    foreach (AttachmentService.AgileFileAttachmentResponseType attachment in attachments)
    {
    if (fileName.Equals(attachment.name))
    {
    isExists = true;

    if (currentAttachmentRowId == null || currentAttachmentRowId < attachment.rowId)
    {
    currentAttachmentRowId = attachment.rowId;
    byte[] bytes = attachment.content;
    }

    }
    }
    }
    }
    }

    • 2684 views
    • 1 answers
    • 0 votes
  • Agile User Asked on July 26, 2016 in Other APIs.

    This is how I resolved the issue:

    1) Created the inner query and set to case insensitive using sql syntax like Select * from [classname] where [mywhereclauses…]
    2) Created the outer query but only the select part like “Select * from [classname]
    3) Set this outerquery to case insensitive
    4) Build the whereclause separately for this outerquery using the inner query
    5) Set the whereclause –> query.setCriteria(myWhereClauseUsingTheInnerQuery)
    6) Execute

    Hope this helps

    • 1915 views
    • 2 answers
    • 0 votes
  • Agile User Asked on July 26, 2016 in Other APIs.

    Patrick,

    For me the issue turned out to be namespaces. 
    My functions were in the form:

    public myMethodResponse myMethod(){

    }

    Somehow during generation of wsdl or maybe another point a response object for myMethod was being generated with the same name myMethodResponse and so there were two objects with the same name causing conflict. 
    I changed the function’s name and the issue got resolved.

    Hope this helps

    • 2248 views
    • 2 answers
    • 0 votes
  • The API guide shows that the event is triggered for only approve and reject. However, if you have tested that it is being also triggered for acknowledge then a following solutions comes to mind:

    1) Get the signoff users by using the function getSignOffForGroups. This should return all the users/user groups that have signed off ideally. 
    2) The ISignOffReviewer has a function getSignOffJobFunction. I have never used it but it returns a string so you can check that..maybe it returns something like ‘Approve’ or ‘Acknowledge’
    3) If that doesnt work then get the workflow from the eventinfo object. Get the current status of the workflow. Get the approvers on that status and see whether the signoff user in step 1 is in that list. If not then it must be another action like acknowledge

    Hope this helps

    Regards,
    Furqan

    • 2262 views
    • 1 answers
    • 0 votes
  • Hello Karthik,

    There is no way to know the rows a user has selected. How do you intend to even send that information as there is no event like selection of table row etc. At best what you can do is that when a user updates certain rows of  a table and click saves then use the Update Table Event to get the table’s dirty rows. The dirty rows will provide the dirty (updated) values. 

    Regards,
    Furqan Tariq

    • 2141 views
    • 1 answers
    • 0 votes
  • Agile User Asked on February 4, 2016 in Agile PLM (v9).

    public void addPriceLines(IPrice price) throws Exception {
    DateFormat df = new SimpleDateFormat(“MM/dd/yy”);
    IAgileClass cls = price.getAgileClass();
    ITable table = price.getTable(PriceConstants.TABLE_PRICELINES);
    IAttribute attr = null;
    IAgileList listvalues = null;
    HashMap params = new HashMap();
    //Set Ship-To Location (List field)
    attr = cls.getAttribute(PriceConstants.ATT_PRICE_LINES_SHIP_TO);
    listvalues = attr.getAvailableValues();
    listvalues.setSelection(new Object[] { “San Jose” });
    params.put(PriceConstants.ATT_PRICE_LINES_SHIP_TO, listvalues);
    //Set Ship-From Location (List field)
    attr = cls.getAttribute(PriceConstants.ATT_PRICE_LINES_SHIP_FROM);
    listvalues = attr.getAvailableValues();
    listvalues.setSelection(new Object[] { “Hong Kong” });
    params.put(PriceConstants.ATT_PRICE_LINES_SHIP_FROM, listvalues);
    //Set Effective From (Date field)
    params.put(PriceConstants.
    ATT_PRICE_LINES_PRICE_EFFECTIVE_FROM_DATE, df.parse(“10/01/03”));
    //Set Effective To (Date field)
    params.put(PriceConstants.ATT_PRICE_LINES_PRICE_EFFECTIVE_TO_DATE, df.parse(“10/31/03”));
    //Set Quantity (Number field)
    params.put(PriceConstants.ATT_PRICE_LINES_QTY, new Integer(1000));
    //Set Currency Code (List field)
    attr = cls.getAttribute(PriceConstants.ATT_PRICE_LINES_CURRENCY_CODE);
    listvalues = attr.getAvailableValues();
    listvalues.setSelection(new Object[] { “USD” });
    params.put(PriceConstants.ATT_PRICE_LINES_CURRENCY_CODE, listvalues);
    //Set Total Price (Money field)
    params.put(PriceConstants.ATT_PRICE_LINES_TOTAL_PRICE, new Money(new Double(52.95), “USD”));
    //Set Total Material Price (Money field)
    params.put(PriceConstants.ATT_PRICE_LINES_TOTAL_MATERIAL_PRICE,
    new Money(new Double(45.90), “USD”));
    //Set Total Non-Materials Price (Money field)
    params.put(PriceConstants.ATT_PRICE_LINES_TOTAL_NON_MATERIAL_PRICE,
    new Money(new Double(7.05), “USD”));
    //Set Lead Time (Number field)
    params.put(PriceConstants.ATT_PRICE_LINES_LEAD_TIME, new Integer(5));
    //Set Transportation Time (List field)
    attr = cls.getAttribute(PriceConstants.ATT_PRICE_LINES_TRANSPORTATION_TIME);
    listvalues = attr.getAvailableValues();
    listvalues.setSelection(new Object[] { “FOB” });
    params.put(PriceConstants.ATT_PRICE_LINES_TRANSPORTATION_TIME, listvalues);
    //Set Country of Origin (List field)
    attr = cls.getAttribute(PriceConstants.ATT_PRICE_LINES_COUNTRY_OF_ORIGIN);
    listvalues = attr.getAvailableValues();
    listvalues.setSelection(new Object[] { “United States” });
    params.put(PriceConstants.ATT_PRICE_LINES_COUNTRY_OF_ORIGIN, listvalues);
    //Create a new Price Lines row and initialize it with data
    IRow row = table.createRow(params);
    }

    This piece of code can be found in the SDK Developer Guide 9.3.4 (Example 21-2)

    • 1962 views
    • 2 answers
    • 0 votes