Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-110958

DDMExpressionFunction concat does not support function parameters anymore

    Details

    • Branch Version/s:
      7.2.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      5
    • Sprint:
      Data_Engine_7.3_21

      Description

      Syntax that worked for concat function in 7.1.x:

      call('getCPInstanceOptionsValues', concat('commerceAccountId=0', ';','groupId=44123', ';','cpDefinitionId=45834', ';','package-quantity=', getValue('package-quantity'), ';','processor=', getValue('processor')), 'package-quantity=package-quantity;processor=processor')
      

      or

      call(
      'getCPInstanceOptionsValues', 
      concat(
         'commerceAccountId=0;groupId=44123;cpDefinitionId=45834;',
        concat(
          'processor=',
          concat(
            getValue('processor'),
            concat(
              ';',
              concat(
                'package-quantity=',getValue('package-quantity')))))),
      'package-quantity=package-quantity;processor=processor')
      

      is not supported in 7.2.x anymore:

      concat expects Array, and array does not support function expressions. For example this does not work:

      call('getCPInstanceOptionsValues', concat(['commerceAccountId=0;groupId=44123;cpDefinitionId=45834',';package-quantity=',getValue('package-quantity'),';processor=',getValue('processor')]), 'package-quantity=package-quantity;processor=processor')
      

      I get exception:

      com.liferay.dynamic.data.mapping.expression.DDMExpressionException$InvalidSyntax: The expression syntax is invalid
      

      Also I got suggestion to go concatenating with + operator:

      call('getCPInstanceOptionsValues', 'commerceAccountId=0;groupId=44123;cpDefinitionId=45834'+';package-quantity='+getValue('package-quantity')+';processor='+getValue('processor'), 'package-quantity=package-quantity;processor=processor')
      

      it ends up in BigDecimalException...

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              leonardo.barros Leonardo Barros (Inactive)
              Reporter:
              igor.beslic Igor Beslic
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Engineering Assignee:
              Leonardo Barros (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                30 weeks, 2 days ago

                  Packages

                  Version Package
                  7.2.X
                  Master