Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2717

Allow unboxing and widening primitive conversions in property injection

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • jBPM 4.4
    • jBPM 4.3
    • Runtime Engine
    • Windows Vista, java 1.6, jboss 4.2.2.GA

      I ran into a problem with accessing boolean properties of an eventListener.
      I've attached a patch to trunk of ./modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java that adds a test that exposes this problem.

      Basically, the example below fails with the error
      "org.jbpm.pvm.internal.wire.WireException: couldn't initialize object 'null': couldn't find property setter setCreateXml for value true"

      JPDL-fragment:
      <event-listener expr="#

      {stateApprovalAction}

      ">
      <property name="createXml">
      <true/>
      </property>
      </event-listener>

      Java-fragment:
      public void setCreateXml(boolean createXml)

      { this.createXml = createXml; }

      Workaround: changing the Java-side to use a Boolean instead of a boolean for the method parameter.

      While there is a workaround, I will still suggest supporting both Boolean and boolean-based setters.

        1. booleanPropertyBugTest.diff
          2 kB
          Per Christian Henden
        2. JBPM-2717.patch
          4 kB
          HuiSheng Xu

              aguizar_jira Alejandro Guizar (Inactive)
              perchrh Per Christian Henden (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: