2 Replies Latest reply on Jan 28, 2013 2:16 AM by Sathya_17_7_1980

    Setting PONR in submit/process amendment flow help

      Hi - Good wishes..

      I've 5 manual tasks in current order. I enabled amendable option and defined key.
      Now after completion of 3rd task, i'm trying to place new order with same key. I'm fine with it. (compensation working fine).I'm able to get desired output.

      Now i would like to declare ponr, for ex -
      Scenario 1 - if pending order completed @ 4th task, i should restrict placing new order with same key.
      Scenario 2 - I'm creating order Status member in data dictionary, that i would like to update status after each tasks.
      if status reaches 5, i should stop accepting new order with same key

      Here how should i achieve it? Can you please share some sample xquery code for above 2 scenarios, so that it'll b helpful.
      Also, i need to add that xquery in process or submit amendment? and wht is the difference between these?

        • 1. Re: Setting PONR in submit/process amendment flow help
          Hi, I am familiar with the mechanism in 7.0.3, not sure whether and how this may have changed in 7.2
          The PONR is controled via the Transition Condition for the Submit Amendment transaction in the order state policy.

          There is one example in the design studio help, which, I believe, return fn:true or fn:false.

          Another example from O2A where it resturn fn:true or fn:error, where I think the advantage is that you can do a custom error message to be returned in the web service

          Let me start with the simpler case 2 from your scenarios:

          let $taskData := fn:root(.)/GetOrder.Response
          let $orderStatus := $taskData//orderStatus/text()

          if ($orderStatus = "PonrReached")
          then fn:false()
          else fn:true()

          The other would be more difficult to achieve, because you would need to see the order history.
          Basically there are two ways IMO to do it, xml api or ws GetOrderProcessHistory.
          But to access the XML API you need the context object and I do not this the application give it to you here - you would need to test it or ask support.
          To access the WS you would need to go through a data instance but I do not see the way to define one for the PONR statement which in 703 is the Transition Condition.

          Anyway, as a workaround, if none of the abovementioned ways to access the process history is possible, the simples way for you would be to define a task notification automator on say task 4 state completed which will set the element to the required value.

          Hope this helps.