Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-19760

Fix mvel scripting parameter is not evaluated

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.10, 8.2
    • Fix Version/s: 7.10-HF11, 8.3
    • Component/s: Automation

      Description

      Create a script called kSendMailToSupplier with parameters as param1 and param2:

      function run(input, params) {
        	Console.info(params.param1);
        	Console.info(params.param2);
        Console.info(ctx.ChainParameters.param2);
        
      	Console.info("Informations");
      }
      

      and an automation chain calling it:

      - Context.FetchDocument
      - Context.SetVar:
          name: mavar
          value: zevaliou
      - javascript.kSendMailToSupplier:
          param1: valeurendur
          param2: "coucou @{\"lalala\".toString()} hohoho"
      

      This can be triggered with a button for example, this is not important.

      The MVEL is not evaluated and even putting string litterals around it like coucou in this case, does not force the String conversion.

      The current script displays the following:

      2016-06-03 14:33:39,855 WARN  [http-bio-0.0.0.0-8080-exec-39] [org.nuxeo.automation.scripting.helper.Console] [INFO] valeurendur
      2016-06-03 14:33:39,855 WARN  [http-bio-0.0.0.0-8080-exec-39] [org.nuxeo.automation.scripting.helper.Console] [INFO] org.nuxeo.ecm.automation.core.scripting.MvelTemplate@1ab74a19
      2016-06-03 14:33:39,856 WARN  [http-bio-0.0.0.0-8080-exec-39] [org.nuxeo.automation.scripting.helper.Console] [INFO] null
      2016-06-03 14:33:39,856 WARN  [http-bio-0.0.0.0-8080-exec-39] [org.nuxeo.automation.scripting.helper.Console] [INFO] Informations
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 minute
                  1m