Sterling OMS Writing First Java Program
Sterling OMS Writing First Java Program : In this session we are going to see how to write simple java program and deploying in Sterling OMS. We are working on creating video version of this tutorial.
IBM Sterling Tutorial : Prerequisites
- Eclipse installed and little knowledge on Eclipse (Creating Java Project, Export Jar, Adding Jars to classpath)
- Java JDK installed & Basic Knowledge on Java (Package, Class, Method)
- OMS Installed and able to login into application
Creating New Project in Eclipse
- Install Eclipse
- Open Eclipse
- Create new Java Project
- Give project name as SterlingCustom94
- In Eclipse go to java build path and add Jars from “<OMS Install Directory>\jar\smcfs\9.4”
- In Eclipse go to java build path and add Jars from “<OMS Install Directory>\jar\platform_afc\9_4”
- Under src create package com.oms94.test
- Under package com.oms94.test create new SOP.java file
- Write following code in Java file & Save file make sure no compile time error
package com.oms94.test; import org.w3c.dom.Document; import com.yantra.yfs.japi.YFSEnvironment; public class SOP { public Document print(YFSEnvironment env, Document doc) { System.out.println("hi"); return doc; } }
Export Jar and Add part of OMS
- Export project and create SterlingCustom94.jar file under C:\deploy\SterlingCustom94.jar
- Run below command from OMS bin folder (One time Activity)
install3rdParty.cmd customjar 1 -j C:\deploy\SterlingCustom94.jar -targetJVM EVERY
customjar : Folder Name 1 : Version Number -j : Jar File C:\deploy\SterlingCustom94.jar : file to be considered -targetJVM : What all the cfg file; this jar file needs to be added
- Jar file automatically copied into <Install Directory>\jar\customjar\1\SterlingCustom94.jar
- Below lines get added in 3 files (APPDynamicclasspath.cfg, AGENTDynamicclasspath.cfg, and dynamicclasspath.cfg files)
- VENDOR_JAR=<OMS Install Directoty>\jar\customjar\1\SterlingCustom94.jar
- Next time you can export the custom jar directly into <Install Directory>\jar\customjar\1 from Eclipse
- Perform Build and deploy
OMS Build & Deployment
- Go to bin folder
- Run command : deployer.cmd -t resourcejar
- Run command : buildear.cmd -Dappserver=weblogic -Dwarfiles=smcfs,sbc -Dearfile=smcfs.ear -Dnowebservice=true -Ddevmode=true -Dnodocear=true -Dwls-10=true create-ear
- Ear file gets created under <Install Directory>\external_deployments\smcfs.ear
- Create new folder deploy and C:\
- Run command : del C:\deploy\smcfs.ear (Clean up any existing file)
- Run command : copy <Install Directory>\external_deployments\smcfs.ear C:\deploy\smcfs.ear
- Deploy manually using weblogic console from folder C:\deploy\smcfs.ear
Create New Service in OMS
- Go to Application Manager — General — Service
- Create new service with name “SOP” and service group name as “Custom”
- Select Option as “In a Synchronous Mode”
- Add API from components tab and connect the start and end
- Select Extended API radio button
- API Name : SOP
- Class Name : com.oms94.test.SOP
- Medthod Name : print
- Save
Using API Tester Call the Service
Call the Service from API tester
API Name : SOP
IsFlow : Y
Result
Result gets display in weblogic console. “Hi” from print() method got invoked and displayed.
If you have any question or suggestion please email to : support@activekite.com
Good!
Thank you
nobody could have explained better
Thanks Ankush for your wonderful comments. This comments keeps as motivated to do more. Please share all your feedback on each post, we like to make change as per your comments. Thanks once again.
Really useful. Thank you
Thanks keep sharing your feedback on each post. Thanks again
Pingback: Sterling OMS Template Customization - Learn IBM Sterling Order Management System
Pingback: Sterling OMS Overriding customer_overrides.properties - Learn IBM Sterling Order Management System
Thanks admin
This post was really helpful. Really doing a great job.
Could you please provide details about hangoff table?
Priya
Hangoff table is any table created with parent child relation called as hang-off table. For example you have yfs_order_line and you create child table
keeping yfs_order_line as parent. order_line_key column will be used as foreign key. 1 record from parent and child can have multiple records. Hope this helps !!!
Hi admin
Please share the video of this tutorial.
Thanks in advance
Priya
We don’t have video for the same. Thanks
Looking for training in IBM OMS