7 Replies Latest reply on Jul 15, 2006 5:35 PM by ncapito

    Simple Problem Literal Problem

    ncapito

      Do you all support this construct that is in the spec? :
      Spec:

      <from> ... literal value ... </from>
      


      <copy>
       <from>1</from>
       <to variable="myXSDString" part="int_2" />
      </copy>
      



      I am having issues trying to get an int constant in my script.


        • 1. Re: Simple Problem Literal Problem
          aguizar

          Given the construct you quote, I assume you are using BPEL 1.1. The corresponding behavior should be:
          from-spec extracts the literal value (1) as a text info item
          to-spec replaces the content of the element info item that represents the message part with the extracted value
          The value of part int_2 should be:

          <int_2>1</int_2>

          Is this different from the behavior you are seeing? If so, what specific issues are you facing?

          • 2. Re: Simple Problem Literal Problem
            ncapito

            I get an error if i try the 1 example. It says...

            2006-07-14 16:24:08,711 ERROR org.jbpm.bpel.xml.ProblemHandler] MyWorkFlow.bpel(285) cvc-complex-type.2.3: Element 'from' cannot have character [children], because the type's content type is element-only.



            FYI bpel block:
            <assign>
             <copy>
             <from>1</from>
             <to variable="serviceRequest_NewAmbiguityTrack" part="int_2" />
             </copy>
            </assign>


            • 3. Re: Simple Problem Literal Problem
              aguizar

              I just added a test for this case: AssignExeTest.

              That test uses BPEL 2 syntax. I forgot that, in BPEL 1.1, only elements are allowed in the literal variant of . If you prefer working in this version, use the expression variant:

              <from expression="1" />


              • 4. Re: Simple Problem Literal Problem
                ncapito

                 

                <from expression="1" />




                Thats what i originally used. THe problem that i was having was i was trying to use an int. So when i did the expression it crashed because of a number format exception. I guess i will just use two strings, and do some conversions do get the strings to what i want.



                Thanks for the help.

                • 5. Re: Simple Problem Literal Problem
                  aguizar

                  The number format exception is actually a bug. Check out BPEL-197.

                  • 6. Re: Simple Problem Literal Problem
                    ncapito

                    The work around for the bug worked....


                    To all who are interested here was how i assigned an int constant






                    Thanks.

                    • 7. Re: Simple Problem Literal Problem
                      ncapito

                      Code didn't make it:

                      <copy>
                       <from expression="string(1)" />
                       <to variable="MyVar" part="myInt"/>
                      </copy>