1 2 Previous Next 24 Replies Latest reply on Jul 1, 2008 5:07 AM by Tom Baeyens

    PVM EL

    Jorge Morales Master

      Will PVM have some kind of Expression Language (like jBpm) to access variables in the execution?

        • 1. Re: PVM EL
          Tom Baeyens Master

          yes. with a default implementation based on unified el.

          • 2. Re: PVM EL
            Tom Baeyens Master

            ... and the future tense you used was a correct assumption :-)

            • 3. Re: PVM EL
              Jorge Morales Master

               

              "tom.baeyens@jboss.com" wrote:
              ... and the future tense you used was a correct assumption :-)


              Does this mean that is not going to make it to 1.0?

              • 4. Re: PVM EL
                Tom Baeyens Master

                it will be in 1.0

                • 5. Re: PVM EL
                  Edward Staub Expert

                  Please consider use of JSR-223 (Java Scripting Framework) for both scripting and EL) - this would provide scripting-language independence.

                  We've played with using Groovy (via JSR-223) for both scripting and EL. Early returns are really encouraging - you can debug into Groovy using most Java debuggers, and the overall cohesion with Java is really tight.

                  • 6. Re: PVM EL
                    Tom Baeyens Master

                    i'll definitely have a deeper look at jsr 223 before i start.

                    i thought that jsr 223 would be more for activities, which i thought is a bit different from the expressions i had in mind

                    • 7. Re: PVM EL
                      mvaldes Novice

                      I see the benefit of using the JSR223 to let the choice of the scripting language you want to leverage: beanshell, groovy...

                      definitely something we will check at both PVM and languages extensions sides.

                      but what are the uses cases you see on using scripting and EL on workflow/BPM ?

                      On my side I see the following ones:

                      - Conditions in transitions
                      - users - roles assignments/delegations
                      - actions

                      anything else ?

                      I'm most familiar with using scripting languages from java than using EL so do you think both approaches are complementary ? meaning, I see EL as a more user friendly approach than using scripting languages inside a workflow/BPM engine but I feel like either we go for native support of scripting languages either EL...

                      thoughts ?

                      regards,
                      Miguel Valdes

                      • 8. Re: PVM EL
                        Tom Baeyens Master

                         

                        "mvaldes" wrote:

                        - Conditions in transitions
                        - users - roles assignments/delegations
                        - actions


                        those are the 3 main ones that i see as well.

                        Below is the test that i got working over the weekend. Only JUEL is supported in the plain build, but that is because of library dependencies. I had to rebuild the jsr223 api for java5. Adding another script language should not be more then adding a line to the script-manager and providing the necessary libs.

                        EnvironmentFactory environmentFactory = EnvironmentFactory.parseXmlString(
                         "<contexts>" +
                         " <environment-factory>" +
                         " <script-manager default-language='juel'" +
                         " read-contexts='execution, environment, environment-factory' " +
                         " write-context='execution'>" +
                         " <script-language name='juel' factory='com.sun.script.juel.JuelScriptEngineFactory' />" +
                         " </script-manager>" +
                         " </environment-factory>" +
                         "</contexts>"
                         );
                        
                         ScriptManager scriptManager = environmentFactory.get(ScriptManager.class);
                         Execution execution = ProcessFactory.build().done().startExecution();
                         execution.setVariable("pv", "hello");
                        
                         Environment environment = environmentFactory.openEnvironment();
                         try {
                         assertEquals("hello", scriptManager.evaluate("#{pv}", execution, null));
                        
                         } finally {
                         environment.close();
                         }
                        


                        • 9. Re: PVM EL
                          Ronald van Kuijk Master

                          also:
                          - setting timers dynamically based on processvariables
                          - choosing a specific subprocess runtime instead of designtime (e.g. with one main process and many different subprocesses per customer)

                          There was a lot of request for them, specifically the first one.

                          I had to mention these since I implemented and documented them, including unit tests ;-)

                          • 10. Re: PVM EL
                            Tom Baeyens Master

                             

                            "kukeltje" wrote:
                            also:
                            - setting timers dynamically based on processvariables
                            - choosing a specific subprocess runtime instead of designtime (e.g. with one main process and many different subprocesses per customer)


                            great ideas.

                            can you add those to jPDL 4 ?

                            http://wiki.jboss.org/wiki/JbpmJpdl4

                            • 11. Re: PVM EL
                              Joram Barrez Master

                               

                              setting timers dynamically based on processvariables


                              I agree, this is something I really could use!
                              Until now, I've always used a custom ActionHandler to change these kind of timers.

                              • 12. Re: PVM EL
                                Jorge Morales Master

                                In jPdl 3.2 it is possible to search in custom scopes extending the VariableResolver. As I see in your example, there is a "read context" and "write context" but it seems no possible to use the contexts as named contexts in EL, like the following:

                                #{myContext.variable1}
                                #{myOtherContext.variable1 = myContext1.variable22}
                                


                                Things like this make tuning process definitions very easy. Also for transition evaluation.

                                Thanks,

                                • 13. Re: PVM EL
                                  Tom Baeyens Master

                                  exposing the context namesin the expression resolver is a good idea.

                                  • 14. Re: PVM EL
                                    Ronald van Kuijk Master

                                    @Joram: setting timers based on variables is already possible in 3.2 HEAD.... it is even documented. You can even add/subtract in them

                                    1 2 Previous Next