Monday, July 18, 2011

JDev11g PS2 - XSLT designer limitations

There will be scenarios when you need to pass a counter variable /any status value into a transformation. Since Jdev 11g design supports multiple source transformation it’s easy to pass multiple variables as input into XSLT. The only issue that developers will encounter is the below error.

"Source parts of variables are either simple type or complex type, thus cannot be used to create mapper file".

1.    If you try to use a variable which is a simple type created in BPEL, it will through up this error.
As a workaround you can create an element in XSD which is of complex type
XSD file code snippet

<xsd:schema xmlns:xsd=""
  <xsd:element name="loopCounter" type="CounterType"/>
  <xsd:complexType name="CounterType">
      <xsd:element name="count" type="xsd:int" />

Create a variable in BPEL by using this element. This will work with XSLT designer.

2.    In case you are using a message type and the message type is added in a WSDL file which is not attached to any partner link, then the same error will occur.

WSDL file code snippet
<definitions targetNamespace=""
    <xsd:schema targetNamespace=""
        <xsd:schema xmlns:xsd="">
            <xsd:import namespace="" schemaLocation="xsd/test.xsd"/>
  <message name="Counter">
        <part name="body" element="tns1:loopCounter"/>


 You will have to copy the types and message type definition to the WSDL file which is associated with any of the partner link present in the process. This is not a good practice as we are modifying the end system /interacting system wsdls, for internal use of the process flow.

So the best approach will be to use the first workaround as it is clean and neat and serves the purpose.

No comments: