4 Replies Latest reply on Sep 22, 2006 7:15 AM by mgommeringer

    How to test script expressions

    mgommeringer

      Hello everyone,

      I have some questions about testing and validating script expressions within a processdefinition:

      Is there a way I can verify the correctness of the syntax of a beanshell script? At best I would like to do this verification before a new processdefinition is deployed into the database.

      Is there a simple way to unit test beanshell scripts from the processdefinition.xml? (where the default jBPM variables like executionContext etc. are already initialized)


      For me it is important to validate the "handmade" beanshell scripts as early as possible because they are quite error-prone since they are made without any IDE support.

      Thanks in advance and regards,
      Matthias

        • 1. Re: How to test script expressions
          kukeltje

          aren't your scripts implicitly tested if you have do complete unit tests of the processdefinitions?

          • 2. Re: How to test script expressions
            mgommeringer

            Hmm. That's right. But the reason why I use script expressions is to allow the developer to make little changes for the running system on the fly. Then, the modified processInstance is deployed on the production system without running any unit test. If the modifications in the script are now broken, a RuntimeException will occur. This is what I want to avoid...

            • 3. Re: How to test script expressions
              kukeltje

              In our situation nobody is allowed to make modifications in any running environment without having it tested in an acceptance environment. Certainly not scripts which can influence the flow of a process dramatically.

              • 4. Re: How to test script expressions
                mgommeringer

                Okay. Think I should consider to do it in your way. Perhaps I can deploy it first on our testing system and run the test suite there. Can you give me a hint how your acceptance environment looks like? Does it need an IDE installed?
                Thank you very much.