Code Robo
Virtual Service
Comparator
Tester
Converter
Utility
Java Code Complience
Validator
Formatter
EncoderDecoder
How To Do Customization.
       Talk to EasyAssistant

This page demonstrate How To Customize Sterling Application ..

Customization of Sterling Commerce Application is difficult task. This steps help you on customize the application.
Before Starting Customization, Please go-through the following product documentations

Following customizations can be done on Sterling Commerce Application.

1.0 Queue Creation:

  • Loging to SAM : https://localhost:9443/sma/sma/console/login.jsp
  • Navigate to System>Property Management > Create Property (Click on '+' sysmbot)
  • Create the property name="PROVIDER_URL" . Category="yfs" PropertyValue="/oms/devtoolkit_docker/jndi" Factory Value="" DataType="". Rest of the text values should be "N"
  • Click on the ""Create" button in the top corner
  • Create physical queue with the command
    cd /oms/devtoolkit_docker/compose
    ./om-compose.sh add-queue CREATE_ORDER_IN
    
    

1.0.1 Create Integration Server:

  • Open configurator / application Manager : https://localhost:9443/smcfs/console/login.jsp
  • Go to Order Fulfillment ProcessType > Service Tab > Click On '+' icon > Select Asynchronous Radio Button > Add JMS queue Trans Port Type component + API Component > Connect Them. There should be a green bold Line.
  • Select bold line AND add all parameters.
  • Set following runtime parameters:
  • Sub Service Name = any name (e.g. CreateOrdInt_0) Name = Queue name (e.g. CREATE_ORDER_IN); Initial Context Factory = File ; Connection Factory = AGENT_QCF; Provider url = file:///oms/devtoolkit_docker/jndi ( You will get this value whcn you create the queue using above commmand)
  • Create a new Server MY_CREATE_ORDER_SRV
  • Select api component and set createOrder api. Save it
  • Start integration server with the following command:
  • startIntegrationServer.cmd

1.0.2 Create A service (Service Name: PostToQ)to post message to CREATE_ORDER_IN queue: :

  • Open configurator / application Manager : https://localhost:9443/smcfs/console/login.jsp
  • Go to Order Fulfillment ProcessType > Service Tab > Click On "+" icon > Select Synchronous Radio Button > Add JMS Queue Trans Port Type component > Connect Them. There should be a green bold Line.
  • Set the following values. Sub Service Name = any name (e.g. CreateOrdInt_0) Name = Queue name (e.g. CREATE_ORDER_IN); Initial Context Factory = File ; Connection Factory = AGENT_QCF; Provider url = file:///oms/devtoolkit_docker/jndi ( You will get this value whcn you create the queue using above commmand)

Note: If you are getting any of the following error white starting the integration server.
JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE'). [system]: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').

Failed to connect to queue manager 'OM_QMGR' with connection mode 'Client' and host name 'mqserver(1414)'."
com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'OM_QMGR' with connection mode 'Client' and host name 'mqserver(1414)'. Check the queue manager is started and if running in client mode, check there is a listener running.
Or
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'mqserver(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2538;AMQ9205: The host name supplied is not valid. [3=mqserver,4=TCP]],3=mqserver(1414),5=RemoteTCPConnection.resolveHostname]
Or
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9205: The host name supplied is not valid. [3=mqserver,4=TCP]

Solution: Make an entry like 127.0.0.1 mqserver in /etc/hosts file
Example:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 mqserver



1.0.3 Create Agent Server:


Agent is a time trigger transaction. So to create an agent we need to create custom transaction.
  • Open configurator / application Manager : https://localhost:9443/smcfs/console/login.jsp
  • Go to Order Fulfillment ProcessType > Transaction Tab > Click On '+' icon > "Do not derived from abstract transaction" Radio Button> Go to Time Trigger tab. > Check the check box 'It's a trime trigger tansaction' > Add a Java class name > Save It > Add JMS queue Trans Port Type component + API Component > Connect Them. There should be a green bold Line.
  • Add A agent Criteria .
  • Add Criteria Parameters.
  • Provide JMS queue details as shown during integration server creation
  • Set following runtime parameters:
  • Queue name (e.g. CUSTOM_AGENENT_Q); Initial Context Factory = File ; Connection Factory = AGENT_QCF; Provider url = file:///oms/devtoolkit_docker/jndi ( You will get this value whcn you create the queue using above commmand)
  • Create an new Agent server (e.g. CUSTOM_TABLE_PURGE_SRV ) or select any existing DefaultAgent server.
  • . Save it
  • Start Agent Server with the following command:
  • Go to /runtime/bin folder and invoke agentServer.cmd <Server> Name (e.g. CUSTOM_TABLE_PURGE_SRV
  • Trigger Agent Server with the following command:
  • Go to /runtime/bin folder and invoke triggeragent.cmd <Server> Name (e.g. CUSTOM_TABLE_PURGE_SRV)



1.1 Log Setup

How to enable logging for your custom java classes:
Create a log4jconfig.xml file and put in deltalog4jconfig folder under resources directory under global (global > resources > deltalog4j ).
This log4jconfig.xml should contain information about your custom java packages.

<?xml version="1.0" encoding="UTF-8"?>

<log4jconfigdelta>
   <category additivity="false" class=" Full class name(including package name) of yfc log category " name="com.easy">
     <level class=" Full class name(including package name) class name of yfc log level " value="DEBUG"/>
    <appender-ref ref="CONSOLE"/>
    <appender-ref ref="ALL"/>
  </category>
</log4jconfigdelta> -
View Product Documentation For Log4J Configuration

2. Database Customization:

  • Add Column to product table
  • Create custom hang-off table with order header table
  • Create independent table

2.1 Add "EXTN_PREFERENCE" column in ITEM table
  • Make and entry for the new column "EXTN_PREFERENCE" for the ITEM table in the ....../extensions/global/entities/Extensions.xml. If this file is not there create a new file taking a copy from ...../runtime/repository/entity/extensions/Extensions.xml.Sample
  • Start Database instance if it's not running.
    				cd /oms/devtoolkit_docker/compose 
    				./om-compose.sh start <databse server> (e.g; oracleserver, db2server)
    				
  • Build extension jar. Execute following command :
    				cd /oms/devtoolkit_docker/runtime/bin
    				./sci_ant.sh -f ../devtoolkit/devtoolkit_extensions.xml importfromproject -Dprojectdir=/oms/project
    				
    				
  • Deploy Extension Jar
    				cd /oms/devtoolkit_docker/compose 
    				./om-compose.sh update-extn /oms/devtoolkit_docker/extensions.jar 
    				
  • Stop the database server instance and Start entire applic ation instan ce
  • Check the ITEM table. You should see the new column.
    Open https://localhost:9443/smcfs/yfshttpdbi/sterlingdbqueryclient.jsp
    to check the new column.
2.2 Create a custom table "EXTN_PARTERNER_DETAILS" table and have relationship with ORDER_HEADER table
2.3 Create a custom table "EXTN_PARTERNER_DETAILS" table with will not have relationship with any product table

3. Foundation / Backend Customization:
  • Building custom service, condition, action, agent, integration server
  • Event, User Exit Customization
  • Custom Transaction, Status, Pipeline Changes

3.0 Building and Deploying Custom Code
  1. Write a Java Class It may extends YIF Custom Api have a public method which returns document and it accept YFS environment object and document object
  2. Create a folder/directory named 'project'.
    				 cd /oms 
    				 md project
    				 chmod 777 project
    				
  3. Create src and lib folder inside project directory.
    				cd /oms/project
    				md lib
    				md src
    				chmod 777 lib
    				chmod 777 src
    				
  4. put/upload your java file in /oms/project/src folder. Example: If your package name is com.easy. You need put the file in /oms/project/src/com/easy folder
  5. If you are using any 3rd party jar files, upload them in /oms/project/lib folder. Example:- My java code uses 3rd party class StrUtil.class and its in easycommon.jar. I should upload the easycommon.jar file in /oms/project/lib folder
  6. Stop the server if its running. Execute following command :
    				cd /oms/devtoolkit_docker/compose 
    				./om-compose.sh stop
    				
  7. Start only Database server as it's required during entity build.
    				cd /oms/devtoolkit_docker/compose 
    				./om-compose.sh start db2server ( or oracleserver for oracle)
    				
  8. Build extension jar. Execute following command :
    				cd /oms/devtoolkit_docker/runtime/bin
    				./sci_ant.sh -f ../devtoolkit/devtoolkit_extensions.xml importfromproject -Dprojectdir=/oms/project
    				
    				
  9. Update extension jar. Execute following command from :
    				cd /oms/devtoolkit_docker/compose
    				./om-compose.sh update-extn /oms/devtoolkit_docker/extensions.jar 
    				
    				
Sample Custom Java Code:
 
package com.easy;
import java.util.Properties;
import org.w3c.dom.Document;
public class TestService implements YIF CustomApi {

	public Document testMethod(Environment env, Document doc) {
		doc.getDocumentElement().setAttribute("Training", "EasyCodeForAll");
		return doc;
	}

	@Override
	public void setProperties(Properties arg0) throws Exception {

	}

}
3.1 Developing Custom Service:
  1. Write a Java Class which extends YIF Custom Api
  2. It should have a public method which returns document and it accept YFS environment object and document object
  3. Open Application Manager. Go to any process type and service tab. Create a new service of type extended api.
  4. Provide the Java class name with package name and method name. Api name can be given same as method name..
  5. Add your java class in your project folder and do a build and deployment.
  6. Test the service with API tester - Invoke the service from API tester with a sample XML
  7. You should get an XML as output of the service
.
Example Code:
 
package com.easy;

import java.util.Properties;
import org.w3c.dom.Document;
import com.easy.StrUtil;

public class TestServiceEasyK implements YIF Custom Api {
	Properties prop;
	public Document testMethod(Environment env, Document doc) {
		doc.getDocumentElement().setAttribute("Training", "EASY_CODE");
		System.out.println("TESTING_CUSTOM CODE DEPLOYMENT WITH 3RD PARTY DEPENDANT JAR");
		return doc;
	}

	@Override
	public void setProperties(Properties arg0) throws Exception {
		prop = arg0;
	}

}


3.2 UE Implementation:
  1. Write a Java Class which implements UE interface (e.g. beforeCreateOrderUE)/li>
  2. Implement the interface methods (unimplemented)
  3. In the method body. put your custom logic. Process the input XML and after processing return the input XML as output. check the API java doc to find out what kind of value UE method takes and what kind of value UE returns
  4. If you add any new attribute which is not there in the UE input XML structure, it will not be passed to the UE.
  5. If you add any new attribute which is not there in the UE output XML structure, it will not be available to transaction.
  6. Configure the UE implementation in Application Manager (Configurator)
  7. Invoke API/Transaction with API tester to test the UE
.
Example Code:
 
package com;

import org.w3c.dom.Document;



public class UEImpl implements BeforeCreateOrderUE {

	@Override
	public String beforeCreateOrder(Environment arg0, String arg1) throws UserExitException {
		return arg1;
	}

	@Override
	public Document beforeCreateOrder(Environment env, Document doc) throws UserExitException {
		doc.getDocumentElement().setAttribute("OrderName", "EASY_ORDER");
		System.out.println("UE INVOKED");
		return doc;
	}

}



3.3 Dynamic Condition:
  1. Write a Java Class which implements DynamicConditionEx (e.g. beforeCreateOrderUE)
  2. Implement the evalueCaondtion methods (unimplemented methods). It should return boolean value.
  3. In the evalueCaondtion method body. put your custom logic. Process the input XML and after processing and finally return a boolean value
  4. If your code raise any exception, wrap it with try/catch block. Do not throw any exception. .
  5. Configure the condition in Application Manager (Configurator)
.
Example Code:
 
package com;

import java.util.Map;

import org.w3c.dom.Document;


public class TestDynamicCondition implements DynamicConditionEx {

	Map prop = null;

	@Override
	public boolean evaluateCondition(Environment arg0, String arg1, Map arg2, Document arg3) {
		boolean conditionValue = true;
		try {
			String attrValue = arg3.getDocumentElement().getAttribute("CarrierServiceCode");
			if (attrValue == null)
				conditionValue = false;
		} catch (Exception ex) {
			conditionValue = false;
		}
		System.out.println("conditionValue=" + conditionValue);
		return conditionValue;
	}

	@Override
	public void setProperties(Map arg0) {
		prop = arg0;

	}

}




4. Store UI Customization

Detail steps are given in this page(web-store-ui-customization.html)

5. Call Center Customization:


6. Web Console Customization :


7. SBC Customization:



User Comments:
anonymous(2022-04-16):
Can you please add details of store UI customization
    Reply;

anonymous(2022-07-20):
Can you please add steps and more details for Store Legacy UI customization
    Reply;

anonymous(2022-08-13):
Can you please add details about Exception Monitor?
    Reply;

Subha(2022-08-24):
Thank you much sir it's very helpful
    Reply;
easycodeforall: (2022-04-21)
You are welcome! Let us know if you need any new tool or any new content in any topic.
    Reply


Post Your Comment:
Name :
Email ( Optional) :
Comments / Suggestion (* Required) It is required: :
: