6 Replies Latest reply on Aug 23, 2010 2:26 AM by mwohlf

    def task var in jpdl with jbpm4.4

    dongliu

      Hi,all

          Could I def vars inside task element with jbpm4.4?

          I read user guide , dev guide,xsd,but It seems that ,vars can only be def in process element in jpdl.

          May I miss something?

          How to achieve it?

        • 1. Re: def task var in jpdl with jbpm4.4
          dongliu

          anybody help me?

          • 2. Re: def task var in jpdl with jbpm4.4
            rebody

            Hi Dong,

             

            Yes, you are right.  jBPM-4.4 couldn't support task varaible declaration yet.  But If you declared a variable in task activity, task could also access them.

            • 3. Re: def task var in jpdl with jbpm4.4
              dongliu

              Thanks for you reply.

              It will be supported in the future?

              • 4. Re: def task var in jpdl with jbpm4.4
                rebody

                Hi Dong,

                 

                Please tell me what is the different between task variable and process variable.  Could you show me a scenario?

                 

                Thank you very much.

                • 5. Re: def task var in jpdl with jbpm4.4
                  dongliu

                  Hi,HuiSheng

                      I think task variable only be accessed for the task who declare it ,while process variable can accessed fro all.For different task they may be have variables that have same variable name,but the value is different.Of course,I could do some extra work to achieve this,But ,It would be very conveniencent if task could declare it's own variables in jpdl.

                     I also think elements,such as task,state,should have an id attribute in jpdl def ,name attribute should only for human reading in jpdl photograph.

                  • 6. Re: def task var in jpdl with jbpm4.4
                    mwohlf

                    Hi dong,

                    I think it is already possible to have task scoped variables in jBPM4 programatically:

                     

                    final EnvironmentImpl environment = processEngine.openEnvironment();

                    try {

                      task.createVariable("variableName", "variable value", null , false);
                      Variable myVariable = task.getVariableObject("variableName");
                      myVariable.setExecution(null);

                    } finally {
                      environment.close();
                    }

                     

                    but of course it is a bit hacky