blog image

How to create Java Business Service in IP2017+

There is always need to extend functionality of siebel with JAVA code, the typical usecases are JSON converter, enhanced authenitification which is not out of the box supported in the Oracle Siebel CRM. With introduction of a new architecture with Siebel CRM IP2017 and higher the JAVA code for business services is executed in the tomcat application container. The Siebel business service calls the execution of this java code via http request from siebel server to the tomcat application container. The jar file of your implementation should be placed in the proper directory. The java code should extend Siebel classes and there is a prescribed template of the structure. Here you can find the official documentation :https://docs.oracle.com/cd/E88140_01/books/EAI3/EAI3_EAIJBS.html .

The fast path for creating the Siebel java business service is :

1. Implement your java code by using the defined template , we used Eclipse. This example just copy the input to the output for simplification. The class is SiebelJBSLeakSim and Method is Convert.

package ch.mobi.siebel.service;
import com.siebel.data.SiebelPropertySet;
import com.siebel.eai.SiebelBusinessService;
import com.siebel.eai.SiebelBusinessServiceException;

public class SiebelJBSLeakSim extends SiebelBusinessService {
	@Override
	public void doInvokeMethod(String methodName, SiebelPropertySet psInput, SiebelPropertySet psOutput)
            throws SiebelBusinessServiceException {
	    switch(methodName) {
            case "Convert":
                copyInputs(psInput, psOutput);
                break;
            default:
                throw new SiebelBusinessServiceException("INVALID_METHOD", "Method '" + methodName +
                        "' is not supported");
        }
	}
	private void copyInputs(SiebelPropertySet psInput, SiebelPropertySet psOutput) {
        psOutput.copy(psInput);
    }
	

2. Build the project and create the jar file. For building the project include the vanilla siebel jars in the project as in the screenshot. To create jar use Eclipse Export ->JAVA->jar.

jbs_eclipse 

3. Copy the jar to the tomcat directory, typically /app/siebel/sieb/applicationcontainer/siebel/WEB-INF/lib. Restart the tomcat.

4. Create new workspace and create new Business service with following parameters : Class = CSSJavaBusinessService, in Business Service User Prop set : Name =@class, Value = ch.mobi.siebel.service.SiebelJBSLeakSim

jbs_tools2 

 jbs_tools3

5. Deliver the workspace.

6. Now you can use and call the Business Service „MOBI JAVA Oracle PoC“ with  Method „Convert“ which will just copy the JSONString on the input to the <Value> on the output.

After the java code is executed via business service proxy you see in tomcat following logs :

Typically in the folder : /app/siebel/sieb/applicationcontainer/logs

 siebeljbs_1.log

[SIEBEL INFO]   Thread[http-nio-9012-exec-4,5,main]   [2020-03-26 09:24:08.752] [JBSFactory] Borrowing the object from JMS Pool with SiebelTaskID:ld1c0565.umobi.mobicorp.testM63830ch.mobi.siebel.service.SiebelJBSLeakSim
[SIEBEL INFO]   Thread[http-nio-9012-exec-4,5,main]    [2020-03-26 09:24:08.752] [JBSFactory] Returning the Object to JMS Pool with SiebelTaskID:ld1c0565.umobi.mobicorp.testM63830ch.mobi.siebel.service.SiebelJBSLeakSim

localhost_access_log.2020-03-26.txt

127.0.0.1 -- [26/Mar/2020:09:24:12 +0100] "POST/siebel/jbs/ch.mobi.siebel.service.SiebelJBSLeakSim/Convert HTTP/1.1" 200 4583

For more information contact us. 

 

Skôr ako začneme: nahliadnite do spracovania vašich osobných údajov

Ak navštívite stránku, ktorá zapisuje cookies, v počítači sa vám vytvorí malý textový súbor, ktorý sa uloží vo vašom prehliadači. Ak rovnakú stránku navštívite nabudúce, pripojíte sa vďaka nemu na web rýchlejšie. Náš web vám ponúkne relevantné informácie a bude sa vám pracovať jednoduchšie.

Súbory cookies používame najmä na anonymnú analýzu návštevnosti a vylepšovanie našich web stránok. Ak si nastavíte blokovanie zápisu cookies do vášho prehliadača, je možné, že web sa spomalí a niektoré jeho časti nemusia fungovať úplne korektne. Viac info k spracúvaniu cookies.