Sunteți pe pagina 1din 3

Page 1 of 1

"> BPEL File Adapter Left-Pads Fixed Length Output Fields By Default [ID 433152.1] Modified 13-JUN-2008 In this Document Symptoms Cause Solution Type PROBLEM Status PUBLISHED

Applies to:
Oracle(R) BPEL Process Manager - Version: 10.1.3.1 This problem can occur on any platform.

Symptoms
A BPEL process uses a file adapter to write data to a file. The output data consists of multiple fields. In the output file, these fields are left-padded with blanks. The expected behaviour is that the fields should be right-padded, i.e. "left-justified".

Cause
The behaviour is caused by the fact that the schema definition used by the BPEL process, defined at http://xmlns.oracle.com/pcbpel/nxsd defines the style of fixed width elements to be left-padded by default, via the attribute nxsd:padStyle. If the XSD file used to define the file output does not the contain this parameter, the default value nxsd:padStyle="head" is used.

Solution
1. Edit the XSD file used by the file adapter in JDeveloper 2. Find the element definitions for the output dields, for example:
<xsd:element name="C1" type="xsd:string" nxsd:style="fixedLength" nxsd:length="20"> </xsd:element>

3. Add the attribute nxsd:padStyle="tail" to these element definitions, for example:


<xsd:element name="C1" type="xsd:string" nxsd:style="fixedLength" nxsd:length="20" nxsd:padStyle="tail"> </xsd:element>

4. Recompile, deploy and execute the process.

Related Products

Middleware > Service-Oriented Architecture > SOA Suite/Platform > Oracle(R) BPEL Process Manager

Keywords JDEVELOPER; XSD

Back to top Copyright (c) 2007, 2010, Oracle. All rights reserved. Legal Notices and Terms of Use | Privacy Statement

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=PROBLE... 12/12/2011

Page 1 of 2

"> How to create a custom XSLT extension function for BPEL [ID 728497.1] Modified 02-OCT-2008 In this Document Goal Solution References Type HOWTO Status PUBLISHED

Applies to:
Oracle(R) BPEL Process Manager - Version: 10.1.2.0 Information in this document applies to any platform.

Goal
You would like to create a custom function to be used in the transformation. This note describes how to do it

Solution
1. In JDeveloper create a new class
package oracle.sample; import import import import import import java.io.IOException; java.text.DateFormat; java.text.SimpleDateFormat; java.text.ParseException; java.util.Date; java.util.Calendar;

public class SampleExtensionFunctions { public SampleExtensionFunctions() { } public static Double toKilograms(Double lb) { return new Double(lb.doubleValue() * 0.45359237000000002D); } public static String replaceChar (String inputString, String oldChar, String newChar) { return inputString.replace(oldChar.charAt(0), newChar.charAt(0)); } public static String changeDateFormat(String dateIn) { DateFormat dfin = new SimpleDateFormat("yyyyMMdd'T'HHmmss"); DateFormat dfout = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); Date in=null; String out=null; try { in = dfin.parse(dateIn); } catch (ParseException e) {} out = dfout.format(in); return out; } }

Please make sure that the package is oracle.sample and the class name is SampleExtensionFunctions. toKilograms() and replaceChar() are the functions already provided by default, while changeDateFormat() is a new function that you are trying to add. 2. Compile the code. 3. Make a directory "d:\oracle\sample" and place the compiled class in the directory. 4. Open SampleExtensionFunctions.jar using winzip and delete SampleExtensionFunctions.class Add compile class d:\oracle\sample\SampleExtensionFunctions.class to SampleExtensionFunctions.jar using Winzip, making sure that the full path is saved. 5. Exit from JDeveloper. 6. Place a new SampleExtensionFunctions.jar in the $ORACLE_HOME\integration\jdev\jdev\lib\ext 7. Open SampleExtensionFunctions.xml and add the following:
<function name="sample:changeDateFormat" as="string"> <param name="dateIn" as="string"/> </function>

8. Start Jdeveloper and create a new asynchronous process with transformation activity. Select user defined function on the right side - and as can be seen "changeDateFormat" is present. Select transformation activity > Edit > Click on "edit Mapping" > select mapping field > right click > Test. Click on the "generate" button and change input to the following:
<input>20071011T120330</input>

and observe the following input and the result: Source

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=HOWTO... 12/12/2011

Page 2 of 2

<?xml version="1.0" encoding="UTF-8" ?> <ext1ProcessRequest xmlns="http://xmlns.oracle.com/ext1"> <input>20071011T120330</input> </ext1ProcessRequest>

Target
<?xml version="1.0" encoding="UTF-8"?> <client:ext1ProcessRequest xmlns:client="http://xmlns.oracle.com/ext1"> <client:input>2007-10-11T12:03:30</client:input> </client:ext1ProcessRequest>

9. Deployment
l l

Place SampleExtentionFunctions.xml in the following directory: $ORACLE_HOME\integration\orabpel\system\classes Under $ORACLE_HOME\integration\orabpel\system\classes create a subdirectory: oracle\sample and place SampleExtensionFunctions.class in the $ORACLE_HOME\integration\orabpel\system\classes\oracle\sample directory.

10. Restart BPEL and the custom extension function is ready for use.

References

Related Products

Middleware > Service-Oriented Architecture > SOA Suite/Platform > Oracle(R) BPEL Process Manager

Back to top Copyright (c) 2007, 2010, Oracle. All rights reserved. Legal Notices and Terms of Use | Privacy Statement

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=HOWTO... 12/12/2011

S-ar putea să vă placă și