[jboss-jira] [JBoss JIRA] Created: (JBPM-924) Allow "raw" String in FieldInstantiator

andrew cooke (JIRA) jira-events at lists.jboss.org
Mon Apr 2 14:09:52 EDT 2007


Allow "raw" String in FieldInstantiator 
----------------------------------------

                 Key: JBPM-924
                 URL: http://jira.jboss.com/jira/browse/JBPM-924
             Project: JBoss jBPM
          Issue Type: Feature Request
          Components: BPEL
    Affects Versions: jBPM GPD 3.0.8
            Reporter: andrew cooke
         Assigned To: Tom Baeyens


Hi,

General problem: we have an action that takes as a parameter a value of type Object (it's a message payload, and so really can be any Object  - for in-memory transport it doesn't even need to be serializable).  When we specify the action parameter as a String we get an exception from FieldInstantiator because the "intelligent" logic checks the argument type and tries to call (reasonably enough) the constructor Object(String).  This constructor doesn't exist and so we get a failure.

In case that wasn't clear, the XML is:
<process-definition>
  ....
    <action class="OurClass">
      <ourParam>string value</ourParam>
    </action>
  ....
</process-definition>

Now this would work if the String "string value" was simply passed to OurClass.setOurParam(Object), which is what you might expect, looking at the config file.

Specific fix: What I would suggest to fix this is a small extension to the logic in FieldInstantiator.getValue which checks to see whether the constructor (line 145) exists and, if not, checks whether the target type is a superclass of String.  If it is (ie Object) then it should return the String (which is a valid Object).

Does that make sense?  Thanks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list