JCAPS Web Service – Creating Fault Message

1. In your JCD, throw Exception
2. In you BPEL, add “catch all exception” by dragging the icon into your BPEL (see image below)

From Work Screen Caps

3. Click on the “catch”, and then click on “show property sheet” button. Select the appropriate Exception name and output from the select drop down options.

From Work Screen Caps

4. Drag “throw” icon inside your “catch”, and then drag the arrow connecting from your “catch” to your “throw”. Right click on the arrow and select add business rule. (see image below)

From Work Screen Caps

5. Add the appropriate business rule. Below is an example.

From Work Screen Caps

6. Click on “throw” and then click on “show property sheet” button. Select exception name and output from the drop down options.

From Work Screen Caps

7. The important thing is when u check your code, these exist:

From Work Screen Caps

Convert java.util.Date to JCAPS DateTime Object

The only reference that I found for doing this is from here.

My own code to do the reverse:


com.stc.codegen.util.TypeConverter typeConverter = new com.stc.codegen.util.impl.TypeConverterImpl();
java.util.Date now = new java.util.Date();
String textFormatDate = "yyyyMMdd hh:mm";
java.text.SimpleDateFormat defaultDateTimeFormat = new java.text.SimpleDateFormat( textFormatDate );
String nowString = defaultDateTimeFormat.format( now );
com.stc.otd.xsd.datatype.DateTime dateTime = typeConverter.stringToDateTime( nowString, "yyyyMMdd HH:mm", false, "" );
myOtd.setEffectiveDate( dateTime );