Showing posts with label websphere integration developer. Show all posts
Showing posts with label websphere integration developer. Show all posts

Wednesday, January 25, 2017

Calling an EJB from SCA module

Create an import EJBPrint with same interface as EJB remote interface .
You should have added the EJB client jar to J2EE module dependencies of SCA module.




Now drag and drop a Java Component Component1 on the Assembly diagram .


Create an new interface . Create a new reference to the above created import EJBPrint .
Right Click the component and generate implementation.This will generate a class file (java source code)
Add code in your generated java file under the to be implemented block. The to be implemented method name will be same as
the operation name in the interface of Component1.
Following is an example code

        System.out.println("Calling EJB");
        ServiceManager manager = new ServiceManager();
        AEJBClassRemote RemoteEJBObject=(AEJBClassRemote)manager.locateService("AEJBClassRemotePartner");
        RemoteEJBObject.print();
        System.out.println("called imported EJB");
       
where
AEJBClassRemote is the remote interface of EJB and RemoteEJBObject.print() is the method invocation on object .
ServiceManager manager = new ServiceManager(); , manager.locateService("AEJBClassRemotePartner"); is the standard step to locate
the import component and AEJBClassRemotePartner is the reference to import EJBPrint from the Java Component Component1.








Now , go to SCA module , dependencies and include EJB client jar to be deployed with module .






Monday, January 23, 2017

Create a simple SCA module

Go to File , New , Module in the Business Integration Perspective
Give the module name as aSCAModule



















Right Click Integration Logic and create new Business Process



 

Select MicroFlow





Put a snippet in between Receive and Reply 












Go to snippet , properties
Drag and Drop  expression on the visual palette , write a string inside the expression box and
print to log using the drag and drop standard visual snippet


















Go to aSCAModule, Assembly diagram  and drag ,drop the aBusinessProcess just created 


Save the changes , Do a clean and build and publish changes to the server .

Your first SCA module is ready


You can right click the module and test the module .
You will see that the string message is printed in the server log .