3 Replies Latest reply on Jan 25, 2010 8:38 PM by Craig Bensemann

    JBPM task description localization via EL

    Robert Becker Newbie

      As stated before, i am trying to create a dynamic jbpm toto-List for my app. I also want do include the task description for each task, which should be dynamic resolved for internationalization.

      For example this task:

      <task-node name="approve request">
           <task name="consider request">
                <assignment pooled-actors="#{licenseRequestAssigner.approvers}"></assignment>
           <transition to="acknowledge denial" name="denied"></transition>
           <transition to="acknowledge approval" name="approved"></transition>

      The pooled-actors are resolved properly but the description remains unchanged so that the el-expression will be printed out in the view. Is this the normal behaviour?

        • 1. Re: JBPM task description localization via EL
          Craig Bensemann Novice

          I have found the same behaviour. Basically the EL in description appears to resolve variables that are stored in the BUSINESS_CONTEXT only. I will try to document the work around I am using below.

          In your task definition do something like this:

          <task\-node name\="approve request">
              <task name\="consider request" description="#{description}">

          Then in your controller bean you would have something like:

              @Out(scope = ScopeType.BUSINESS_PROCESS, required = false)
              private String description;
              @In private Map<String, String> messages;
              //other class code omitted
              public String save() {
                  description = messages.get("my_descripton_key");
                  // your other processing code here

          Hope this makes sense.

          • 2. Re: JBPM task description localization via EL
            Robert Becker Newbie

            Thank you. But I solved this problem in a different way: i simply stored the message-key in the task description and let the view resolve it. This has some benefits i didn't think of the first time. Firstly if you update your message-bundle the task-descriptions will be updated too and secondly if people with different locales are working on the same task they would get only the translation from the actor who started the task if it were resolved upon task-deployment.

            • 3. Re: JBPM task description localization via EL
              Craig Bensemann Novice

              I figured you had solved it as it was such an old post. I just found it while I was looking for a solution to a similar problem and thought I would share my solution. Thanks for sharing yours - I hadn't thought of sharing a message key but I'm sure that will come in handy in the future. I needed to store the actual values as they are user entered description fields so I don't need to worry about internationalization.