Skip to Content
avatar image
Former Member

Queries in Agentry Rules

Hi Friends

I have a requirement like, Based on ItemType we need to display values like Product ID, Description and Quantity

My logic is like below

if(ItemType.equals("ZSPF")||ItemType.equals("ZSPI")||ItemType.equals("ZSPR")||ItemType.equals("ZSPN")){

  log.info("ItemType is"+ItemType);

  multiMap.put("Product ID", Product ID);

  multiMap.put("Description ", Description );

  multiMap.put("Quantity", Quantity);

  }

Same thing i need to achieve using Rules,

Please help me

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 07, 2015 at 07:10 AM

    Based on ItemType we need to display values like Product ID, Description and Quantity


    These values are in Item Collection under Service Order Object

    Add comment
    10|10000 characters needed characters exceeded

    • Vignesh,

      Bill asked me to help with this.  Since you are looping over Item objects, you don't need the "current object" syntax.  You can't use the if condition that you wrote here: "ItemType.equals("ZSPF") || ItemType.equals("ZSPI") || ItemType.equals("ZSPR")|| ItemType.equals("ZSPN")".  Agentry doesn't understand that syntax.  You need to use Agentry functions to do the same thing:

      IF

           OR

                EQSTR

                     ItemType Property

                     ZSPF

                EQSTR

                     ItemType Property

                     ZSPI

                 EQSTR

                     ItemType Property

                     ZSPR

                 EQSTR

                     ItemType

                     ZSPN

           CONCATENATE

                ProductID Property

                Description Property

                Quantity Property

           OR

                EQSTR

                     ItemType Property

                     Something Else

           CONCATENATE

                Something Else

           CONCATENATE

                Neither is True

      The above checks if Itemtype is ZSPF or ZSPI or ZSPR or ZSPN and returns a string with ProductID + Description + Quantity.  Else if ItemType = "Something Else" then we return a string with "Something Else". Else if neither is true, we return a string with "Neither is True".  All the hard coded string values are hand typed constants.

      Jason Latko - Senior Product Developer at SAP