3 Replies Latest reply on Oct 18, 2005 6:47 PM by Ronald van Kuijk

    Need help on Passing values to the Action class constructor

    fname lname Newbie

      Hi

      I would like to pass the values from process-definition.xml file to the constructor (java file) which I configured in the tag.

      Herewith I pasted the code below...Please duggest what I am doing wrong below.

      process-definition.xml

      ...
      <action class="com.sample.TestBean" config-type="constructor">
      not null
      true

      ...


      not null enclosed inside the value element.
      true enclosed inside the check element.
      check element has one attribute called type which contains the value as boolean.

      public TestBean(String value, boolean check) {
      log.info("value is " + value);
      log.info("type is " + check);
      }

      Also, please tell me how can I access a particular method in the action class.

      Thank you.

        • 1. Re: Need help on Passing values to the Action class construc
          Ronald van Kuijk Master

          please when posting code/xml use the

          tags.

          Besides that, if you read the docs (http://docs.jboss.com/jbpm/v3/userguide/jpdl.html#configurationofdelegations) , what you want is not possible. You can use either
          - fields
          - bean (setters)
          - constructor (which takes the whole config part and pases it as text)

          Some kind of reflection to pass variables as individual paramaters in a constructor is not supported (as stated in the docs)

          Besides that, the execute method is called. It is not possible to call specific methods in an actionhandler directly from the processdefinition.



          • 2. Re: Need help on Passing values to the Action class construc
            fname lname Newbie

            Hi

            Thank you for your immediate reply.

            In our project - we used the Spring framework for configuring all the classes which defines a workflow. Now the requirement got changed and planning to use the jBPM instead of Spring.

            In Spring configuration xml file - we are directly accessing a particular method which is not possible using jPBM (as per your response).

            So, is there any way to use Spring configuration xml file inside jBPM?

            or

            Can Spring be replaced entirely with jBPM?

            Your response is greatly appreciated.

            Thanks,
            Kumar.S

            • 3. Re: Need help on Passing values to the Action class construc
              Ronald van Kuijk Master

              spring and jbpm server completely different purposes. So replacing one with the other seams (no pun intended) not the way to go. They are complementary.

              I do not know spring enough to give you pointers. sorry. But there are spring/jbpm intgegration things going on (I have no link so you have to search that on the internet)