7 Replies Latest reply on Aug 4, 2009 3:52 AM by tom.baeyens

    Task I18N support

    gleenders

      I use jBPM 4 just on task level to indicate to different users their next tasks. I don't use a task form, just a brief description of what their task is and a button where they can execute the task the moment it''™s done.

      Because I want to use this system in Belgium this can only be done with i18n support. For the moment this is not implemented in jBPM 4.

      Searching for I way to implement this or a workaround these are my current thoughts/considerations:
      Tasks translations should be in a sub-node under task in the jpdl.xml file. Since they are part of the process definition (changing a translation will result in a new process definition version).
      I think we can discuss on this: is the translation really part of the definition?
      If yes, then the only possibility is to include it in the jPDL as said above.
      If no, we have to bind it to the task definition key (who seems to be the task name). So in that case it would be possible to foresee a system to implement i18n task support by providing a properties file or an extra database table (both based on the task name as part of the key).
      The drawback of this system is that it would be possible to change the translations within a jBPM version.

      One way or another I would like to have a method on '˜Task'™ [public String getDescription(String locale)] who just returns the description translation based on the locale.

      Regards,
      Gert

        • 1. Re: Task I18N support
          kukeltje

          Well, xml has the notion of 'lang' on attributes so that would be my fisrt choice.

          For descriptions, that is easy and whether this attribute/element really holds the value or just an el that references to an external properties file (the java way) is debatable but not realy important.

          For tasks it is a different story, since the task name (without the lang attribute) is really used as a value, so not many options there, unless adding additional name elementes with lang added does not pose a problem.

          One other solution is to teach the Walloons to speak Dutch since with 31% they *are* the minority ;-) (but in the mean time teach Tom how to speak French)

          The thing is, you do not need to change the core initially: http://planetjbpm.wordpress.com/2009/07/05/73/

          • 2. Re: Task I18N support
            jbarrez

            I'm not sure if i18n should be done on the jBPM level. Imo, translations should be done in the 'normal' Java way (ie with resources and placeholders that are resolved when the view is rendered).

            The story is different for taskforms, there is the situation not the same.

            • 3. Re: Task I18N support
              gleenders

              Joram,

              So, then your opinion is that the translations are not part of the definition?
              The result of this approach is that you can change a translation without a new deploy. The drawback of this is that in this case there is not a track of this change.

              So for the system you propose (normal 'Java' way) I assume that I just have to base my placeholder on the tasks name since that's the Taks 'Key' field?

              Regards,
              Gert

              • 4. Re: Task I18N support
                kukeltje

                I have my doubts... task also has an attribute called description. Why should that be there and a translated description not? (regardless of easier redeploying or not)

                With regard to this, I Would have liked a separate name and id on the nodes where you transition to the id but can display the name. Both can be the same (and will be if not edited manually) but don't have to be. Often I run into translating spaces in names to _ since I cannot use the name as an 'id' the way it is. This is not a jBPM4 issue btw, was/is also a 'problem' in 3. (sorry for partially threadjacking)

                • 5. Re: Task I18N support
                  gleenders

                  No problem for thread jacking.

                  I agree on the fact that you would like a separate id and name. This would simplify some things.
                  Correct me if I'm wrong but for the moment and don't even find a description attribute for task.
                  Gert

                  • 6. Re: Task I18N support
                    kukeltje

                    The description is in the XSD at least. Not seen if it is in the code as well.

                    • 7. Re: Task I18N support
                      tom.baeyens

                      translations should be done in the UI layer. we won't pursue this in our console any time soon, i think.

                      but you can always leverage the core engine and build translations on top of it.

                      <task name="mytask" form="myform"...

                      String lang = ...get the user language...;
                      String formResource = task.getFormResourceName() + "-" + lang + ".form";
                      ...render the form...

                      Will get you the form in the specific language.

                      Also your form technology would have to be capable of resolving the form parameter keys to translated texts where appropriate.

                      In summary: we want to make sure that the engine allows for you to build your translatable forms on top of jBPM. But we won't be shipping translation features out of the box any time soon.