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

Mvel results not updated when Automation Tracing enabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.0-HF13, 7.4, 7.10
    • Fix Version/s: 6.0-HF24, 7.10-HF02, 8.1
    • Component/s: Automation
    • Tags:
    • Sprint:
      TGV 11

      Description

      As a result of NXP-17114, if a chain runs a subchain, and the subchain sets a context variable each time it runs, the context is not updated with the new setting when the subchain runs a second, third, fourth ... time.

      MvelTest.java
          @Test
          public void testMvelOnList() throws Exception {
              try {
                  service.putOperation(RunOnListItem.class);
                  OperationContext ctx = new OperationContext(session);
                  String input = "dummyInput";
                  ctx.setInput(input);
                  ArrayList<String> users = new ArrayList<String>();
                  users.add("foo");
                  users.add("bar");
                  users.add("baz");
                  users.add("bum");
                  ctx.put("users", users);
                  
                  factory.toggleRecording();
                  
                  OperationChain chain = new OperationChain("testChain");
                  chain.add(RunOperationOnList.ID).set("list", "users").set("id", "mvelchain1").set("isolate", "false");
                  service.run(ctx, chain);
              } finally {
                  service.removeOperation(RunOnListItem.class);
              }
      
      mvelchain1.xml
          <chain id="mvelchain1">
            <operation id="Context.SetVar">
              <param type="string" name="name">myvar</param>
              <param type="object" name="value">expr:Context["item"]</param>
            </operation>
            <operation id="LogOperation">
              <param type="string" name="level">error</param>
              <param type="string" name="message">expr:Context["myvar"].toString()</param>
            </operation>
          </chain>
      

      If recording is enabled, log shows

      13:57:57,718 [main] ERROR [LogOperation] foo
      13:57:57,722 [main] ERROR [LogOperation] foo
      13:57:57,722 [main] ERROR [LogOperation] foo
      13:57:57,723 [main] ERROR [LogOperation] foo
      

      Correct output is

      14:08:44,862 [main] ERROR [LogOperation] foo
      14:08:44,866 [main] ERROR [LogOperation] bar
      14:08:44,867 [main] ERROR [LogOperation] baz
      14:08:44,867 [main] ERROR [LogOperation] bum
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                PagerDuty

                Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.