Example 4 SOAP Use Case: Restricts the Status Change if the Operational Attributes Have No Value

You can write a Groovy script that restricts status change of a change order from interim approval1 to interim approval2 if the operational attribute of the affected items don't have a value.

In the change exit criteria for the Interim Approval 1 to Interim Approval2 phase, the script checks if the affected items' operational attributes have value. If the operational attributes don't have a value, it should restrict the promotion to interim approval2.

Here are the configuration steps:
  1. Create a web service.
    • Web service: PDCS

      URL: https://hostname/fscmservice/ProductDesignChangeOrderService?WSDL

  2. Create a global function in Application Composer.
    Note: This global function is provided only as a reference. Performance might be impacted depending on the number of items and the number of attributes which you're validating.
    • Object: Commercialization Change Order
    • Tab: Item
    • Application Composer Navigation: Change Order -> Global Function Criteria at Interim Approval
    • Function:
      
      def result=adf.webServices.PDCS.getChangeOrder(ChangeId)
      def rtrnVal = true
      println((String.valueOf(result.RevisedItemLine.Item.UnitWidthQuantity).replace("[","")).replace("]",""))
      def UnitWidthQuantity = (String.valueOf(result.RevisedItemLine.Item.UnitWidthQuantity).replace("[","")).replace("]","")
      if(UnitWidthQuantity == "null")
              {
                rtrnVal=false
              }
      return rtrnVal
  3. Set up the item rule in the Rules tab.

    InvokeGlobalFunction("checkOperationalAttr", [ChangeHeader].[Change Header Main].[Change ID])

    Here's how you define the rule in the Edit Rule Set page.

    Change Order Rules
  4. Configure the change order criteria for the change order in the Workflow tab of the Edit Change Order Type page.

    Add the M1ORGCCO as the exit criteria for interim approval status.

    This image shows how to define change order exit criteria