Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-3766

Variables show as marshalled entities in FTL

    XMLWordPrintable

Details

    • Interactive Demo/Tutorial
    • Hide

      Install and configure the jbpm-install.
      Launch the client application logging in as "krisv".
      Start the "Evaluation" process.
      Fill in the "Employee" and "Reason" values with the word "krisv".
      Click the "Submit" button.

      Go to the "Personal Tasks" tab.
      Click the "Refresh" button.
      Select the task listed and click "View".

      The resulting field shows the toString() of the org.jbpm.task.utils.MarshalledContentWrapper class.

      Really wanted to see the value contained in the string for the "reason" field.

      One possible fix is to modify the end of the TaskFormDispatcher.provideForm(FormAuthorityRef ref) with:

      if (input instanceof Map) {

      Map<?, ?> map = (Map) input;
      for (Map.Entry<?, ?> entry: map.entrySet()) {
      if (entry.getKey() instanceof String)

      { MarshalledContentWrapper val = (MarshalledContentWrapper)entry.getValue(); Environment env = EnvironmentFactory.newEnvironment(); ContentMarshallerContext cmc = new ContentMarshallerContext(); ObjectMarshallingStrategy[] strats = (ObjectMarshallingStrategy[])env.get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES); cmc.addStrategy(strats[0]); // Should only have one option here... Object o = ContentMarshallerHelper.unmarshall("org.drools.marshalling.impl.SerializablePlaceholderResolverStrategy", val.getContent(), cmc, env); renderContext.put((String) entry.getKey(), o); }

      }
      }

      Not sure, but there may be a more elegant solution.

      Show
      Install and configure the jbpm-install. Launch the client application logging in as "krisv". Start the "Evaluation" process. Fill in the "Employee" and "Reason" values with the word "krisv". Click the "Submit" button. Go to the "Personal Tasks" tab. Click the "Refresh" button. Select the task listed and click "View". The resulting field shows the toString() of the org.jbpm.task.utils.MarshalledContentWrapper class. Really wanted to see the value contained in the string for the "reason" field. One possible fix is to modify the end of the TaskFormDispatcher.provideForm(FormAuthorityRef ref) with: if (input instanceof Map) { Map<?, ?> map = (Map) input; for (Map.Entry<?, ?> entry: map.entrySet()) { if (entry.getKey() instanceof String) { MarshalledContentWrapper val = (MarshalledContentWrapper)entry.getValue(); Environment env = EnvironmentFactory.newEnvironment(); ContentMarshallerContext cmc = new ContentMarshallerContext(); ObjectMarshallingStrategy[] strats = (ObjectMarshallingStrategy[])env.get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES); cmc.addStrategy(strats[0]); // Should only have one option here... Object o = ContentMarshallerHelper.unmarshall("org.drools.marshalling.impl.SerializablePlaceholderResolverStrategy", val.getContent(), cmc, env); renderContext.put((String) entry.getKey(), o); } } } Not sure, but there may be a more elegant solution.

    Description

      Process parameters passed to FTL are being displayed as marshalled objects rather than the appropriate values.

      Attachments

        Activity

          People

            salaboy@gmail.com Mauricio Salatino (Inactive)
            zoikks Darin Wilcox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: