Changing the default port in WebSphere Application Server

Sometimes we may need to change the default port of a WebSphere Application Server installation as a security precaution or for some other reasons like for coexisting with another WAS installation on the same machine. Moreover it’s always better to change the default ports in production environments. You can follow the below steps to change the default http port.

1. Logon to your admin console :-) (Obviously this is the first step. When we have such a nice interface available why we need to think some other options?).

2. Click on Servers -> Application servers -> .

3. Click on Ports link under communications, under the Configuration tab. (If you expand the Ports section click on details).

4. Click on the port name you want to change. Here I am changing the default http transport port. So I clicked on WC_defaulthost port.

5. Enter the port number you want to use in port text box. (Please make sure that port is not already used by some one else). Apply and save the changes. After entering the new port the WC_defaulthost will look like the one in the below image.

6. Now click on Environment -> Virtual Hosts. This page would display all the virtual hosts present in the system.

7. Click on default_host.

8. Click on Host Aliases.

9. Click on the port you want to change.

10. Enter the new port number.

Apply and Save the changes to Master Repository. You are done. Restart the server and now the server will start binding to the new port.

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!

Creating a Business Calendar in WebSphere Integration Developer 6.1.2

Recently I had bogged about the Business Calendar’s in WID 6.1.2. Today I will be explaining how to create a Business Calendar in WID 6.1.2. Business Calendars are a new feature introduced in WID 6.1.2.

Following are the steps required in creating a Business Calendar.

1. Right click on the module and click on New -> Business Calendar.

2. Enter a name and other details for the business calendar.

3. Our calander window will be opened up.

4. I am going to design a business calendar that works on every week Monday to Friday 9-6 with Dec 25 as the holiday. To design this calendar, click on any examples present. We can define our business calendar using examples or manually. There is no difference between these two approaches except in example based design some data is pre populated. Here I am going with the example based design. So click on the first example itself. For me the first example is ‘January 1 2010′. After modifying the example my calendar looks like the following image which defines my office hours. Every week Monday to Friday 9 AM to 6 PM.

To add a holiday or an exception to this office hours click on Add Exception.

The above exception adds an exception so that Dec 25 will be a non working day.

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!

My last post talked about setting a custom attribute for a human task. Today I will be talking about querying the human task using EJB API based on the custom attribute. The complete code for querying the human task based on custom property is given below.

javax.naming.Context ctx = new javax.naming.InitialContext();
	Object result = ctx.lookup("com/ibm/task/api/HumanTaskManagerHome");
    com.ibm.task.api.HumanTaskManagerHome home = (com.ibm.task.api.HumanTaskManagerHome) javax.rmi.PortableRemoteObject.narrow(result,com.ibm.task.api.HumanTaskManagerHome.class);
    com.ibm.task.api.HumanTaskManager taskManager= home.create();
 
    com.ibm.task.api.QueryResultSet rst = taskManager.queryAll("TASK.TKIID","TASK_CPROP1.NAME='id' AND TASK_CPROP1.STRING_VALUE='1'", null,null,null,null);
 
 
    while(rst.next()){
    	System.out.println("Got Task ID "+rst.getString(1));
    }

In my code I have used the queryAll method for getting all the tasks for the user. The parameters for the queryAll method I used are, the select clause as the first parameter, where clause as the second parameter. Since I was selecting only Task Id, I used TASK.TKIID as my select clause. In the where clause TASK_CPROP1.NAME specifies the name of the custom attribute. For me the custom attribute name was id and TASK_CPROP1.STRING_VALUE specifies the value we are expecting for the custom property. When I created the task I entered 1 as the value for Id. The above query would return you the tasks with custom property name id and value 1.

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!

Have you ever come across a situation where you want to get a specific task instance based on some input data? For eg, if you have an order task, you may want to retrieve the human task based on the order Id. The order Id will be part of the business object and will be available only if you have the human task. When we querying the human task we cannot retrieve human task based on the value of business object associated with it. So to get a task instance with some order Id, it’s not a good solution to get the entire human task and loop through each task to check whether it matches with the order Id we have.

To address this issue WebSphere Process Server and WebSphere Integration Developer provides a nice solution of using custom properties. In WPS and WID you can attach a custom property while creating a human task and it is possible to retrieve the human task based on custom property value.

In today’s post I will be explaining how to create a custom property for a human task. For this I have created a simple Business Object called CustomBO. This will be the business object associated with our human task. My Business object looks like the one shown in the figure.

The interface used in my business process is

Create a human task using the interface we created in the previous step. Once you have created the human task click on properties window and click on Environment.

Click on Add to add a new custom property.

Enter the name for your custom property. The value of the custom property needs to come from the business object. So we will be using a replacement expression as the value from the custom property.

Now click on Ok.

You are done with creating a custom property for a human task.

To run this using BPC Explorer, add your human task to a business process and assemble it in the assembly diagram.

Launch your BPC explorer. Go to processes and start the business process. While starting the business process I entered 1 as the value for my id. Now to view this custom property value in your human task click on ‘My To-dos’ and find out the task we just created. Click on the task and go to the details page. Click on custom properties tab you can see the custom property with the values we specified.

I tried this example in WID 6.1 only. For users of WID 6.0.2 and lower versions, this method will not work (At least it was not working for me). For me in WID 6.0.2 after executing the process, the custom property value was the replacement expression itself. Ie, the replacement expression was not replaced by its value. I think it is because in WID 6.0.2 and lower versions the business object is available only after creating the human task. (Not sure its just a guess from me).

Anyways don’t worry I had used a nice workaround to fix this issue in WID 6.0.2, I created a escalation which will be executed after one second or so and from there reset the value of the custom properties. :-)

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!

Individual Excellence Award

Yesterday was a good day for me. I got an Individual Excellence Award for my contributions in WebSphere Process Server and WebSphere Integration Developer. I am so excited and I just want to share my feeling. Awards are always motivating.

Yesterday we had a MR meeting and at the end of it there was an awards distribution. A couple of other peoples also got some spot awards. But I was the only one who got an Individual Excellence Award. The award consists of a shield, a certificate and some money. I do not have my camera with me now to photograph the shield I got.

I was not aware that I was nominated for Individual Excellence Award. When our Domain Lead announced my name I became so happy and excited. It was a great feeling. I am feeling so motivated now.

Thanks to everyone in my team for helping me to get this award. I know with everyone’s help only I got this award. Thanks to all.

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!

Creating and configuring a MySQL DataSource in GlassFish Application Server.

Follow the below steps for creating and configuring a MySQL DataSource in GlassFish application server.

1. Download MySQL JDBC driver from http://dev.mysql.com/downloads/connector/j/3.1.html

2. Extract the contents of the zip file

3. Copy mysql-connector-java-x.x.x-bin.jar to GLASS_FISH_INSTALL_DIR\lib folder.

3. Start your GlassFish Application server by issuing the command ‘asadmin.bat start-domain domain1′ from GLASS_FISH_INSTALL_DIR\bin directory.

4. Login to GlassFish admin console. The default url for GlassFish admin console will be http://localhost:4848/login.jsf. The default username and password for accessing the admin console will be admin and adminadmin respectively.

5. From Common Task menu expand Resources menu by clicking on Resources menu.

6. Expand JDBC under resources.

7. Click on ‘Connection Pools’ under JDBC menu. The Connection Pools page will be displayed.

8. Click on New.

9. Enter a name for your JDBC Connection pool. Select javax.sql.ConnectionPoolDataSource as your ‘Resource Type’ and select MySQL as your ‘Database vendor’.

10. Click on Next.

11. Fill the details according to your need. Minimum you need to fill the following fields.
a. DatabaseName
b. Password
c. URL (The format will be jdbc:mysql://localhost:3306/test. Where test is your database name.)
d. Url (The format will be jdbc:mysql://localhost:3306/test. Where test is your database name.)
e. ServerName
f. User

12. Click on Finish. You will be taken back to the Connection Pools page.

13. Click on the Connection Pool you created. You will be taken to ‘Edit Connection Pool’ page.

14. Click on Ping. If your connection pool is setup correctly you will get a Ping Succeeded message.

15. Now click on JDBC Resorces under JDBC menu.

16. Click on New.

17. Enter a JNDI Name for your data source. Select the pool you created by following the above steps as your ‘Pool Name’.

18. Click on OK. You are done.

To obtain a connection using the above DataSource, use the following code.

	Context ctx = new InitialContext();
	DataSource ds = (DataSource) ctx.lookup("jdbc/mysqltest");
	Connection con = ds.getConnection();

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!

WebSphere Commerce Developer Enterprise 6.0 installation – Part 1 covers the installation of RAD and WAS Fix packs. Once we have done with all that installation we are ready for our WebSphere Commerce Developer 6.0 installation. If we are planning to install IBM Sales Center as part of our development environment, we need to install IBM Sales Center before installing WCS Toolkit.

To perform the WCS installation follow the below steps. I had already installed IBM Sales Center in my machine.

1. Double click on setup.exe from WCS Toolkit CD. This will bring the installation wizard.

2. Click on Next and from the page appears accept the license.

3. Click on Next and select the installation directory. Please select a directory with no spaces and no long file paths.

4. Click on Next. This screen would ask us to select the installation components. Select the components you want to install. (Select at least the WebSphere Commerce development environment :-) ).

4. Click on Next. This page will be the installation summary page.

5. Now click on next. The installation of WCS Toolkit begins and you will be presented with a screen as shown below.

6. Once the installation is over. Click on Finish and exit the wizard.

We are done with our WCS 6 Toolkit installation. Go to Start -> Programs -> IBM WebSphere Commerce Developer Enterprise 6.0 -> WebSphere Commerce development environment and start your toolkit. Publish a store and start coding.

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!

WebSphere Commerce Developer Enterprise 6.0 installation – Part 1

RAD Installation
WebSphere Commerce Developer is an application that is running on top of Rapid Application Developer 6.0.0.1. The primary requirement for WebSphere Commerce Developer Enterprise installation is RAD 6.0.1.1. If your RAD is an older version, then you need to upgrade your Rapid Application Developer version to 6.0.1.1. Upgrading RAD to version 6.0.1.1 is very easy. Download the packages from http://www-1.ibm.com/support/docview.wss?uid=swg24010926. This page offers two downloads one is to upgrade the Rational Product Updater and another is to upgrade RAD to fix level 6.0.1.1. Follow the instructions mentioned in http://www3.software.ibm.com/ibmdl/pub/software/rationalsdp/rad/60/install_instruction/6011/install.html for upgrading Rational Product Updater and Rational Application Developer. (Don’t ask me what if you have higher version of RAD installed? I don’t know what needs to be done for that. For me my RAD version was below 6.0.1.1 and I followed all the above procedures. :-))

Upgrading WAS Test Client. Installing WAS Fix packs.
Once we have RAD 6.0.1.1, we need a WebSphere Application Server Test Environment version 6.0 updated to a minimum of WAS 6.0.2.5 level. To upgrade WAS 6.0.0 to 6.0.2.5 level, we need to apply three different fix packs. Download WAS Refresh Pack 2 from http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg24009813. The second fix pack we need to download is WAS 6.0.2 Fix pack 3 which is available at http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg24010724. Finally we need to have WAS 6.0.2 Fix Pack 5, available at http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg24011099, to upgrade our WAS Test Environment version to 6.0.2.5.

Once we have our Fix packs downloaded, follow the following steps to install the above Fix packs.

1. Open your command prompt.
2. Navigate to your AppServer’s bin directory. If you have installed RAD to C:\RAD directory, your AppServer bin directory will be C:\RAD\runtimes\base_v6\bin.
3. Execute the command setupCmdLine.bat. This command sets all the required environment variables.
4. Extract the contents of WAS Refresh Pack 2 zip file. (Most probably the zip file name will be 6.0-WS-WAS-WinX32-RP0000002.zip).
5. Copy the contents of ‘updateinstaller’ directory to appserver root directory.
6. Navigate to this updateinstaller directory from your command prompt.
7. Execute the command update.exe. This will start the update installer wizard for WAS refresh pack 2.

8. Click on Next and from the page appeared, point to your AppServer root directory.

9. Click on Next. The page would ask us to select the maintenance operation. Select ‘Install maintenence package’ as the choice.

10. Click on Next. This window will ask us to select the location of maintenance package that we are installing. If we follow all the above steps without fail, it will populate the correct maintenance package location by default. If not the maintenance package will be inside updateinstaller\maintenance directory.

11. Click on Next. This will show you the pre installation summary.

12. Now click on Next. This will start the installation of WAS refresh pack 2.

13. Once the installation is over. We will be presented a screen confirming the installation.

14. Now click on Relaunch button.

15. Follow all the steps from 8 to 13. This wizard will install maintenance package RP6020 for WAS test client.

16. Once the wizard completes the installation exit the wizard by clicking on Finish button.

17. Now our WAS Test client will have 6.0.2.0 as its version.

18. Delete the updateinstaller directory from AppServer root directory.

19. Repeat steps 4 to 18 for installing the refresh pack 3 and 5.

Once you have installed all the required fixes, the WAS Test Client will be upgraded to version 6.0.2.5, the minimum required version for WCS installation. I will cover the installation of WebSphere Commerce Developer Enterprise 6.0. in the next post.

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!

Today I want to introduce an exciting new feature of WID 6.1.2 that I came across while reading a developer works article http://www.ibm.com/developerworks/websphere/library/techarticles/0807_fasbinder1/0807_fasbinder.html?S_TACT=105AGX01&S_CMP=HP&ca=drs- .

In WebSphere Integration Developer 6.1.2 we have the option to create a business calendar which is very crucial when we deal with human tasks. I haven’t upgraded to WID 6.1.2 yet. However looking into the pictures in that article it looks really great. It was a feature that was really missing in the earlier versions of WID.

In my current project we had a requirement to set up an escalation after 8 business hours. When we calculate the business hours we had to exclude Saturdays, Sundays and any other holidays in US. Also our escalation time should not include anything other than the normal business hours. For us we ended up in writing our own business calendar to meet our requirements.

I am wondering how IBM can miss such an important feature in earlier versions of WID. Anyways thanks IBM for adding it now.

I did not see WID 6.1.2 yet, so I am wondering is there any way to set up a time zone also for different tasks or users. This is extremely important when the business works on different geographies and time zones. If it is not already there, that is something IBM should consider in the coming versions.

Also is there any way to modify the calendar without a deployment something like a Business Rule Manager? I feel WPS should have something like that as its does not make any sense for a new deployment just because a new unexpected holiday is coming or we missed to count a holiday at the time of deployment. Let the business users manage the holidays and business timings. Yeah?

Also I feel a date picker for setting the time/date values in WID will be a good addition.

Let me upgrade to the newer version and see what the other new exciting features in WID are.

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!

Most of the WCS developers are confused with the member subsystem and different types of users in WCS. Here is a small post on the different types of WCS users and their differences.

The member subsystem of WCS handles the users of a WebSphere Commerce site (Member subsystem also covers the organizations, member groups, roles and access control policies). Users of a WCS site are the business users or administrators that manage the store or end users who access the site for shopping.

A WebSphere Commerce site can have three types of users. Generic, Guest and Registered users. All the users of any WCS installation fall under any of these categories including business users and store administrators.

A generic user is a user who just accessed the site. Any user accesses a WCS website will have a userId associated. All the generic users share the same userId and for a default WCS installation the generic userId will be -2001 (At least in my case). The generic user does not have any user information.

When a generic user adds an item to the shopping cart, he/she becomes a guest user. All the guest users will have a unique userId associated. This guest user can have personal information stored in the database as they are having a unique userId. This userId is extremely important and is used for tracking their shopping cart.

A registered user is any user who signs up in a WCS system. They will have a username and password for logging into the application. They can have a permanent address in the system. Even the site/store administrators and business uses comes under this category. Any user can become a registered user by signing up or signing in to the system.

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!