Mega Menu

Showing posts with label WCS. Show all posts
Showing posts with label WCS. Show all posts

Thursday, December 14, 2017

Session Management - In Memory Sessions

Maximum In-Memory sessions count is the count of active sessions that can be allowed at any given instance of time. Determining this value exactly may not be possible as the volume of active sessions varies time to time for any given application. 
In order to effectively support the maximum possible sessions, use the flag Allow-Overflow. Turn this to true, to specify that the number of sessions in memory can exceed the value specified by the Max in-memory session count property. 

**Setting this value too low without having the flag Allow-overflow, would result in poor application performance as all the requests would be waiting for a free session. 


NOTE

  • This option is valid only in non-distributed sessions mode.
  • Do not set this value to a number less than the maximum thread pool size for your server.




Wednesday, December 13, 2017

Glimpse of WebSphere Commerce V9.0


This section highlights the core features/capabilities of WebSphere Commerce V9 to the best of my knowledge and understanding. 

New Capabilities
  • Watson Content Hub integration
    • Watson Content Hub (formerly DX Content Hub) gives business owners the power to create iconic, robust, and consistent brand experiences by using cloud-based, cognitive content management capabilities.
  • Generic External Order system integration
  • Generic External Inventory system integration
  • Dynamic Pricing integration
    • Dynamic Pricing 16.4 is a cloud-based pricing system that analyses real-time market data to provide suggestions on how merchandisers can react to competitor pricing and shifts in market conditions. 
  • Taxation integration
    • Integrate WebSphere Commerce with a third-party tax calculation system to provide tax calculations.
  • Payment integration.
    • Integrate Payment Service Provider through payment tokenization.
  • Apple Pay on the Web integration.
  • Externalized Customization (xC).
    • New programming pattern that introduces a separation between the core application components and customizations. 
  • IBM Tealeaf Customer Experience on Cloud integration.
  • Enabled AES (Advanced Encryption Standard) by default.
  • Migration tool to transform EJB beans to JPA.
  • Adoption of Docker to support
    • Distributed deployment topology
    • Certificate management
    • Quick Deploy (with Docker-Compose) without any additional configuration.
  • IBM Customer Service for WebSphere Commerce
    • This enables a CSR to perform key tasks on behalf of the guest, registered customers, for both B2B and B2C business models through the same storefront view as of any customer. 
  • JQuery based Aurora starter store
  • The Store server uses Spring MVC, instead of Struts

Deprecated Functionalities


  • WebSphere Commerce SOI services.
    • Alternate/Recommendation – Use REST service framework to work with the command framework and develop business services.
  • WebSphere Commerce OAGIS messaging.
    •  Alternate/Recommendation – Use REST service framework to work with the command framework and develop business services.
  • Data service layer (DSL) 
    • Alternate/Recommendation – Use the Java Persistence API.
  • Request for Quote (RFQ)
    • Alternate/Recommendation – Integrate with IBM CPQ.
  • ATP inventory model
    • Alternate/Recommendation – DOM Integration.
  • Return process
    • Alternate/Recommendation – Integrate with IBM OMS.

Discontinued Functionalities


  • Support for Microsoft Internet Information Server (IIS) as a Web server.
  • Support for Derby database for developer
    • Alternate/Recommendation – Use IBM DB2.
  • Sterling Configure, price, Quote
    • Alternate/Recommendation – Use Modular Omni-Configurator which is lightweight and enabled for multi-device support.
  • Managed files and managed directories (fileloader, fileprop utilities)
    • Alternate/Recommendation – Use Watson Content Hub or a third-party file server to manage file assets.
  • Search Utilities (crawler, configSearchReplication, setupSearchIndex)
    • Alternate/Recommendation – Command-line search operations are replaced by RESTful APIs.
  • Massload and Massextract utilities
    • Alternate/Recommendation – Use dataload utility.
  • Store Publish utility (publishstore)
    • Alternate/Recommendation – New Gradle script replaces publishstore utility.
  • Configuration Manager Tool (config_server)
    • Alternate/Recommendation – The functionality previously performed by the tool is superseded by the continuous delivery pipeline.
  • Migration Utilities (migrateListPrice, migrateMarketing, migratePromotions, migrateSearchFacet, migrateSolrSearch)
    • Alternate/Recommendation – These are no longer needed and alternate migration approach has been defined.
  • Reset database utility (resetdb) - Developer
    • Alternate/Recommendation – New database can be created in DB2.
  • Reset database utility (resetstores) - Developer
    • Alternate/Recommendation – Project crs-web to be recovered.
  • Reset database utility (restoreDefault) - Developer
    • Alternate/Recommendation – Workspace to be recovered.

Programming Model


  • Presentation tier is further decoupled from the business logic tier to better enable support for multiple sales channels.
  • The Store server uses Spring MVC, instead of Struts.
  • WebSphere Commerce services support RESTful services along with SOI and BOD services. The recommendation is to leverage RESTful services as SOI and BOD services are deprecated in this release.
  • A similar recommendation to Persistence layer to leverage JPA as EJB and DSL are deprecated.







Micro Service Architecture of WebSphere Commerce






  • Commerce components/layers are now loosely coupled.
  • WebSphere Commerce Server, now being called as Transaction Server is separated into FIVE major functional servers to evolve into microservice architecture.
    • Transaction Server
      • Container server that runs transactional business logic and APIs that serve other commerce servers (Request routing, processing storefront transactions, processing REST services, hosting business and administration tools).
    • Store Server
      • Container server that runs storefront for all stores and holds all the storefront assets.
    • Search Server
      • A server that provides search engine capabilities for frontend applications.
    • Customization Server
      • A server that runs custom business logic as xC extensions.
    • Utility Server
      • Container server that runs application administration utilities. This does not exist in the development environment.
  • Each functional server is available as a Docker image.
  • Though the isolation is along well-defined service interfaces, there still exists some minor dependencies between the servers.
  • Store, Search and Customization servers are WebSphere Liberty based, whereas Transaction and Utility Server is WebSphere Application Server based.

Thursday, June 05, 2014

GetOrder service

GetOrder Service cannot be executed on behalf of another user, which is required in case of a CSR trying to access the pending cart of a customer. As of WCS 7.0 FEP6, below changes are required to make this work.

Step2 is something I am trying to explore more on, as it does not look like an appropriate  solution for me. This can be used as a workaround.

Step1:
Add the below snippet in wc-component.xml of WC/xml/config/com.ibm.commerce.order or ideally under WC/xml/config/com.ibm.commerce.order-ext

<_config:authorization-configuration>
<_config:protectable-proxy br="" protectable="com.ibm.commerce.foundation.server.authorization.policymanager.ForUserProtectableProxy"> interfacename="com.ibm.commerce.Order.facade.datatypes.OrderType" />


Step2: 
Load the below ACP



Test Request XML :




Rgds, Raj.

Friday, November 22, 2013

Store and Archive Messages in WCS

Any email or sms or content in any form sent from Websphere Commerce (WCS) using the Out of the Box (OOB) messaging framework through any transported can be stored and also archived.

Eg: Order Transfer to External systems, Sending Emails, etc..

Pre-conditions :


1. While creating the message type, make sure the below option is selected





This selection updates the column PROFILE.ARCHIVEMSG to 1

2. Configure the message transmission as async in the wc-component-client.xml configuration file.


Eg:

<_config:invocationservice>
    <_config:invocationbinding bindingimpl="com.ibm.commerce.foundation.internal.client.services.invocation.impl.JCAInvocationBindingImpl">
     
    <_config:action asynchronous="true" name="MyMessageAction">
     
  (OR)

If you are directly using Messaging class to send messages, invoke

Messaging.sendTransacted ()

which sends a message asynchronously.


 Additional Info:
Messages that are sent to any external system can either be synchronous or asynchronous. In WCS messages can be sent using the task command SendMsgCmd which internally makes use of Messaging class to compose, load config and send messages through the specified transports.

If a message is marked as asynchronous, SendMsgCmd invokes the sendTransacted method of Messaging class which just saves the composed Message as a BLOB object into table MSGSTORE

 The scheduler command SendTransactedMsg, when kicked in scans through the table MSGSTORE and then sends the valid messages (leaving the expired messages) accordingly.
The scheduler in addition checks for the flag PROFILE.ARCHIVEMSG and accordingly arhives/not the message. If this flag value is 1, the message will be sent to an archive table MSGARCHIVE after successful transfer. 







Tuesday, January 15, 2013

IllegalStateException | Command Caching

Any command that extends CacheableCommand can be cached; in other words, both the TaskCommand and ControllerCommand can be cached.

IllegalStateException is thrown when a cached command cannot be serialized. This can happen if any of the variables/objects (class level) are not serializable.

sample command definition:
public class LearnerTestCmdImpl extends ControllerCommandImpl implements
        LearnerTestCmd {
   

    String name;

    MyBean bean;
         .................................
         .................................   

sample bean definition:
         public class MyBean {




 Let's say the command LearnerTestCmdImpl is cached but throws IllegalStateException while it is executed.

This can be resolved in two ways:
1. Make the object (Eg: MyBean Object in above sample) serializable
    i.e;
         public class MyBean implements Serializable {

2. Make the MyBean object transient variable in the command. But any variable/object defined as transient will not be a part of the cache content.
i.e;
public class LearnerTestCmdImpl extends ControllerCommandImpl implements
        LearnerTestCmd {
 

         String name;

         transient MyBean bean;
         .................................
         .................................  


ECException & isRetriable() | WCS Commands

All the exceptions that occur in commands are wrapped into ECException and thrown back. This is of two types :
1. ECApplication Exception : Exception due to any application parameters.
2. ECSystem Exception : Exception due to any system issues.

isRetriable() method of a Command

The isRetriable method returns a Boolean value which specifies whether the command can be retried on a transaction rollback exception. The isRetriable method of the new controller command's superclass returns a value of false. You should override this method and return a value of true, if your command can be retried on a transaction rollback exception.






WCS Users | Overriding isGeneric() Method | Controller Command

Default value returned by the method isGeneric () is false.

If a controller command can be executed by a generic user, this method needs to be overriden to return true.
When the value returned by isGeneric () is false, a generic user will not be able to execute it, instead a new Guest user id would be created and the command execution would complete successfully.

Importance of overriding this method :
To have the application perform better, it is always recommended to override this method to return false for all the commands that are not user specific/dependant.
Else (if not overriden), a new user is always created during the command execution, which may result in the larger DB size, in addition to an extra overhead of populating user bean objects for the command context.


Additional Info:

In the standard WebSphere Commerce implementation there are multiple types of users. These include generic, guest, and registered users. Within the grouping of registered users there are customers and administrators.
The generic user has a common user ID (-1002) that is used across the entire system. This common user ID supports general browsing on the site in a manner that minimizes system resource usage. It is more efficient to use this common user ID for general browsing, since the Web controller does not need to retrieve a user object for commands that can be invoked by the generic user.



Simple Steps to create a controller Command

Steps:
a. Create an interface (MyNewControllerCmd) extending com.ibm.commerce.command.ControllerCommand.

b. Create the class (MyNewControllerCmdImpl) extending com.ibm.commerce.command.ControllerCommandImpl and implementing the interface MyNewControllerCmd.

c. Create a CMDREG entry.
Eg:
insert into CMDREG (STOREENT_ID, INTERFACENAME, DESCRIPTION, CLASSNAME, TARGET)
values (storeent_ID,'com.ibm.commerce.sample.commands.MyNewControllerCmd', 
'This is a new controller command for the business logic tutorial.', 
'com.ibm.commerce.sample.commands.MyNewControllerCmdImpl','Local');
 
d.  Make the struts entry for the command.
Eg: 
com.ibm.commerce.sample.commands.MyNewControllerCmd" path="/MyNewCmd" type="com.ibm.commerce.struts.BaseAction"/> 
 
e.  Create the access control policy
Eg:

  CommandName="Execute">
  
 
   ResourceBeanClass="com.ibm.commerce.sample.commands.MyNewControllerCmd">
 
  
 
f. Stop server and load access control policies into database using acpload.bat file.
 
g.  Basic methods to be implemented in the implementation class
     i. setRequestProperties () - Method to set the request parameters.
     ii  validateParameters () - Method to perform validations of request parameters.
     iii  performExecute () - Method holds the business logic. 

h. The command can now be executed with the following url
http:///webapp/wcs/stores/servlet/MyNewCmd?storeId=
 
 
 
 
 

Controller Command (vs) Task Command

WCS Commands

Any business logic that should be executed on server is written in the form of commands in WCS.
Basic command types:
1. Controller Command
2. Task Command


Controller Command
Task Command
Holds the complete business logic for an action.

Holds a part of logic involved in an action i.e; to execute a specific task.
Can be executed as an independent request.
Cannot be executed as an independent request but should be invoked from another command.
Needs resource level access control policies to be defined and executed.
Does not need access control as this is executed from a controller command which already has the policies defined.
Can be defined specific to a store.
Can be defined specific to a store.

Can be cached
Can be cached
Example:
UserRegistrationAddCmd is used to Register a user.
Example:
UpdateCredentialsCmd is invoked from UserRegistrationAddCmd to encrypt and update the credentials of the user.