3 Replies Latest reply: Feb 11, 2013 11:04 AM by beachw08 RSS

    How to take human task values and store them in DB table

    beachw08
      Hi, I have a workflow and when I assign the task to someone I want to store some info in a database table that I created.

      I have checked the box allow task and routing customization in bpel call backs.
      And under the on Assign message, I put an assign bpel construct and an invoke.
      in the assign construct I am trying to copy some of the elements from my humantasks_globalvariables to certain columns in my database table.
      I have found out you can't copy them directly because the humantasks_globalvariables are of type string and my database columns are anonymous. So I tried using parseEscapedXML(), when I do this I get the error that
      oracle.fabric.common.xml.xpath.XPathFunctionException: parseXML() expects the argument to be either a string or an XML element.

      The humantasks_globalvariable I am using says it's of type string but it gives me this error.

      I am obviously doing something wrong. If anybody know how to take values from a human task and store them in a database table any help would be greatly appreciated.
        • 1. Re: How to take human task values and store them in DB table
          vladodias
          my database columns are anonymous
          What database is that and what actually are the data types in the database? I think the dbadapter schema is not properly defined... Or you're using not supported database/types...

          Cheers,
          Vlad
          • 2. Re: How to take human task values and store them in DB table
            beachw08
            In the actual database the column types are varchar2. But when I drag an invoke from the bpel constructs I associate it with by DBadapter partner link and click the button automatically create input variables. It creates an xsd and this is what one of the elements looks like.
            <xs:element name="anyvalue">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                         <xs:maxLength value="20"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            When I do an assign and try to assign the values from the humantasks_globalvariables xsd there types look like this.

            task:title string

            and the input variable I automatically generated look like this.

            ns7:anyvalue <anonymous>
            • 3. Re: How to take human task values and store them in DB table
              beachw08
              I figured it out. This is all you have to do. Just go to the xsd file that has the same name as your DB adapter partner link. So lets say you called you DB adapter Flag-O-Rama you will look for the file Flag_O_Rama_table.xsd

              on the design tab expand the first complex type and where it says restricts, change that to type. Just click on it and a drop down box will appear.

              now the schema looks like this
              <xs:complexType name="Test">
                    <xs:sequence>
                       <xs:element name="anyvalue" type="xs:string"/>
                    </xs:sequence>
               </xs:complexType>