As promised in the last article, this is a tutorial for Siebel professionals wanting to implement a JBS.
The full source code is available from my LinkedIn Group:Impossible Siebel, for those who want to start running quickly without the usual fiddling around with a new area of configuration.
The Siebel documentation provides some good high level information on the basics of a JBS, but there is no step by step details on how to implement it.
There are a lot of missing pieces that you just have to figure out yourself, and to make things harder, there is little chance we can get it running without Java knowledge.
This is illustrated by one customer who raised the following SR (ID: 490022.1), and asked all the right questions, but the explanation still didnt connect the dots, the author was obviously on a high plane, co-incidently the author who replied to this SR, is one of my favourite engineers on Support Web, Mr Pascal Kitaeff.
Complement of information about Java Business Service [ID 490022.1]
[JBS for Dummies]
Assuming that Siebel professionals dont speak Java, i'll attempt to translate.
Firstly why use a JBS? Using a JBS allows us to implement features that are not available out of the box. We can leverage all of the open source software that already been built and tested, and just plug and play in Siebel.
[Solution Overview]
1) Setup up the Java Subsystem
2) Implement a specialised eScript BS
3) Build a Java Class
4) Implement the program logic in Java
[Pre-requisites]
1. Download and install the Java SDK from http://developers.sun.com/downloads
Dont install this for fun, otherwise it will eat up valuable profile space on space restricted enterprise connected machines.
2. Download and install a JAVA IDE
Eclipse seems to be the most popular www.eclipse.org
or Netbeans, if you want to go for the Sun product
www.netbeans.org
[Setup up the Java Subsystem]
This is the easiest part. Go to your Client CFG file and create the following section
This can also be implemented as a Server profile configuration, see bookshelf for more information, but most developers will want to try this out on the local machine.
[eScript BS]
1. Create a BS based on the class: "CSSJavaBusinessService"
2. Call it "ImposSiebelXSLT Business Service"
3. Create a BS user property with the following values
Name: @class
Value: ImposSiebelXSLT
This BS will be barebones and just pass the method down into the Java class, where the real work will happen.
[Java Class]
If you havn't already done so, you need to have your SDK and IDE installed at this point.
1. Create a new project of type "Java Class Library" called "ImposSiebelXSLT"
2. Link the Siebel.jar file to your project libraries
3. Create a new class called "ImposSiebelXSLT"
4. Add the following code to import the required Clases
5. Add the following code to inherit from the Siebel Business Service class
6. Add the following code to perform the XSLT transformation
7. Compile and place the Jar file into your classpath as defined in your configuration file above.
[Usage]
Now we can call the JBS like any other eScript business service, by passing in input and output property sets.
BS: ImposSiebelXSLT Business Service
[Input Property]
<Value>: XML String
XSLTBuffer: XSLT String
[Output Property]
<Value>: Transformed XML String
[Final thoughts]
Taking the the leap into JBS and using a entirely new XSLT parser can be a risky undertaking, it means that your entire application needs to be regression tested. This is the same problem Siebel would have to face, if it replace its XSLT engine.
So what should we do?
If you dont have any problems with your "EAI XSLT Service", it is best to leave it alone.
Customers who are affected by the 30 namespace problem have a few options as highlighted in the last article.
JBS's arent the solution to everything, but it provides a door to the open source community.
The Java package for this article can be downloaded from LinkedIn: Impossible Siebel
In the final article in this series, i'll look at implementing XSLT 2.0 in Siebel.
The full source code is available from my LinkedIn Group:Impossible Siebel, for those who want to start running quickly without the usual fiddling around with a new area of configuration.
The Siebel documentation provides some good high level information on the basics of a JBS, but there is no step by step details on how to implement it.
There are a lot of missing pieces that you just have to figure out yourself, and to make things harder, there is little chance we can get it running without Java knowledge.
This is illustrated by one customer who raised the following SR (ID: 490022.1), and asked all the right questions, but the explanation still didnt connect the dots, the author was obviously on a high plane, co-incidently the author who replied to this SR, is one of my favourite engineers on Support Web, Mr Pascal Kitaeff.
Complement of information about Java Business Service [ID 490022.1]
[JBS for Dummies]
Assuming that Siebel professionals dont speak Java, i'll attempt to translate.
Firstly why use a JBS? Using a JBS allows us to implement features that are not available out of the box. We can leverage all of the open source software that already been built and tested, and just plug and play in Siebel.
[Solution Overview]
1) Setup up the Java Subsystem
2) Implement a specialised eScript BS
3) Build a Java Class
4) Implement the program logic in Java
[Pre-requisites]
1. Download and install the Java SDK from http://developers.sun.com/downloads
Dont install this for fun, otherwise it will eat up valuable profile space on space restricted enterprise connected machines.
2. Download and install a JAVA IDE
Eclipse seems to be the most popular www.eclipse.org
or Netbeans, if you want to go for the Sun product
www.netbeans.org
[Setup up the Java Subsystem]
This is the easiest part. Go to your Client CFG file and create the following section
[JAVA] DLL = <Program path>\jvm.dll CLASSPATH = <Siebel Tools path>\CLASSES\Siebel.jar;<Siebel Tools path>\CLASSES\ImposSiebelXSLT.jar VMOPTIONS = -Xrs -Djava.compiler=NONE
This can also be implemented as a Server profile configuration, see bookshelf for more information, but most developers will want to try this out on the local machine.
[eScript BS]
1. Create a BS based on the class: "CSSJavaBusinessService"
2. Call it "ImposSiebelXSLT Business Service"
3. Create a BS user property with the following values
Name: @class
Value: ImposSiebelXSLT
This BS will be barebones and just pass the method down into the Java class, where the real work will happen.
[Java Class]
If you havn't already done so, you need to have your SDK and IDE installed at this point.
1. Create a new project of type "Java Class Library" called "ImposSiebelXSLT"
2. Link the Siebel.jar file to your project libraries
3. Create a new class called "ImposSiebelXSLT"
4. Add the following code to import the required Clases
import com.siebel.data.SiebelPropertySet; import com.siebel.eai.SiebelBusinessServiceException; import java.io.*; import javax.xml.transform.stream.*; import javax.xml.transform.*;
5. Add the following code to inherit from the Siebel Business Service class
public class ImposSiebelXSLT extends com.siebel.eai.SiebelBusinessService { public void doInvokeMethod(String methodName, SiebelPropertySet input, SiebelPropertySet output) throws SiebelBusinessServiceException {
6. Add the following code to perform the XSLT transformation
StreamSource xmlSource = new StreamSource(new StringReader(input.getValue())); StreamSource xsltSource = new StreamSource(new StringReader(input.getProperty("XSLTBuffer"))); Writer outWriter = new StringWriter(); StreamResult result = new StreamResult( outWriter ); TransformerFactory transFact = TransformerFactory.newInstance(); javax.xml.transform.Transformer trans; trans = transFact.newTransformer(xsltSource); trans.transform(xmlSource, result); output.setValue(result.getWriter().toString()); output.setProperty("ErrorMessage", ErrMsg);
7. Compile and place the Jar file into your classpath as defined in your configuration file above.
[Usage]
Now we can call the JBS like any other eScript business service, by passing in input and output property sets.
BS: ImposSiebelXSLT Business Service
[Input Property]
<Value>: XML String
XSLTBuffer: XSLT String
[Output Property]
<Value>: Transformed XML String
[Final thoughts]
Taking the the leap into JBS and using a entirely new XSLT parser can be a risky undertaking, it means that your entire application needs to be regression tested. This is the same problem Siebel would have to face, if it replace its XSLT engine.
So what should we do?
If you dont have any problems with your "EAI XSLT Service", it is best to leave it alone.
Customers who are affected by the 30 namespace problem have a few options as highlighted in the last article.
JBS's arent the solution to everything, but it provides a door to the open source community.
The Java package for this article can be downloaded from LinkedIn: Impossible Siebel
In the final article in this series, i'll look at implementing XSLT 2.0 in Siebel.