6/15/2015

Starting and Stopping MS SQL Server from bat file

Start SQL Server:
@echo off

sc query "MSSQL$SQL01" | find /I "STATE" | find "STARTED"
if errorlevel 1 goto :start
goto :end

:start
net start "MSSQL$SQL01"
net start "SQLAgent$SQL01"
rem net start "MSSQLFDLauncher$SQL01"
net start "SQLBrowser"
net start "SQLWriter"

:end

Where clause for condition node in workflow for definition related records in not final status

For TICKET:
(select count(1) from ticket where origrecordid = :ticketid and origrecordclass = :class and status not in ('CLOSED', 'RESOLVED')) = 0
and
(select count(1) from workorder where origrecordid = :ticketid and origrecordclass = :class and status not in ('CLOSE', 'REJECTED', 'CAN', 'FAILPIR', 'COMP', 'FAIL', 'REVIEW')) = 0
For WORKORDER:
(select count(1) from ticket where origrecordid = :wonum and origrecordclass = :class and status not in ('CLOSED', 'RESOLVED')) = 0
and
(select count(1) from workorder where origrecordid = :wonum and origrecordclass = :class and status not in ('CLOSE', 'REJECTED', 'CAN', 'FAILPIR', 'COMP', 'FAIL', 'REVIEW')) = 0

6/03/2015

SQL query for searching responsible person group for classification looking from bottom level to top level classification tree

If you want to define common responsible person group for all child classification elements hierarchy from top to down element, by defining responsible person group only for one top classification element, you can use the following sql query to define relationship for the object (e.g. TICKET, WORKORDER etc., all objects which has classstructureid attrribute) with persongroup object.

5/20/2015

SQL Query for classification description updating

If you want update description of classification, you have to update field "description" in two tables. Example:
update classstructure set description = 'Description' where classificationid = 'IT010303'
update classification set description = 'Description' where classificationid = 'IT010303'

5/18/2015

Maximo Jars for Maximo Java Development

1. maximo\lib\*.jar
2. maximo\lib\j2ee.jar
Extracted from maximo.ear:
3. businessobjects.jar
4. maximouiweb.war\WEB-INF\classes (zipped to maximouiweb.jar)

5/08/2015

Simple Excel VBA macros for swapping two rows

Sub SwapRanges()
  Dim ra As Range: Set ra = Selection
  msg1 = "You have to select TWO ranges of cells of the same size"
  msg2 = "You have to select 2 ranges of cells of the SAME size"
  If ra.Areas.Count <> 2 Then MsgBox msg1, vbCritical,"Error":Exit Sub
  If ra.Areas(1).Count <> ra.Areas(2).Count Then MsgBox msg2, vbCritical,"Error":Exit Sub
  Application.ScreenUpdating = False
  arr2 = ra.Areas(2).Value
  ra.Areas(2).Value = ra.Areas(1).Value
  ra.Areas(1).Value = arr2
End Sub
p.s.
And not only rows. You can swap any 2 equal areas:

How to use VBA macros:

5/07/2015

Hide the Search panel on the Start center in IBM Control Desk 7.5.3, 7.5.1.2



If you want to hide Search panel on Start center and make expanded by default "Go To Application" menu in IBM Control Desk 7.5.3, 7.5.1.2, you have to do the following steps:

1. Go To > System Configuration > Application Designer
2. Select Action > Export System XML

5/04/2015

How to hide the additional search panel in the applications

If you want to hide this new panel, which have been appeared in the latest versions of SmartCloud Control Desk 7.5.3 (7.5.1.2), you have to change System property
mxe.webclient.searchMenubar from 1 to 0.

Before changing:

and the result will be next:

4/20/2015

HASH for password "P@ssw0rd"

If you want to reset password to "P@ssw0rd" for any user, for example for maxadmin user, you have to update field "password" in table "maxuser" by value "0xA587F52BA133CA479D56F780F84840BC" using CONVERT function.
use maxdb75;
update maxuser set password =
CONVERT(VARBINARY(128), '0xA587F52BA133CA479D56F780F84840BC', 1) where userid = 'maxadmin';
p.s.
only for maximo internal authorization, SQL Server

2/24/2015

VMWare - Guest operating system static IP address

1. Note the MAC of the VM
2. On the host machine open C:\ProgramData\VMware\vmnetdhcp.conf
    a. Or C:\Documents and Settings\All Users\Application Data\VMware\vmnetdhcp.conf
    b. These 2 files are auto synced or mirrored.
    c. Open the editor in Administrator mode. Eg notepad++. Otherwise you will get access denied message
3. Add a new entry at bottom of the configuration file, right before the "# End" marker. MyGuestVM is any unique name. Example below

host sunilW2008Server {
hardware ethernet 00-0C-29-05-2B-A0;
fixed-address 192.168.63.222;
}

3. Shutdown the VM and close the Workstation
4. Re-start the VMWare DHCP and NAT services for changes to take effect (From services.msc)

2/21/2015

How to Delete Websphere Application Server Profile ?

First list all profiles on a server:
List the profile using one of these commands

  • Windows: was_install_dir\bin\manageprofiles.bat –listProfiles
  • UNIX/Linux: was_install_dir/bin/manageprofiles.sh –listProfiles

Remove a WebSphere Application Server profile:
Delete the profile using one of these commands:

  • On Windows: was_install_dir\bin\manageprofiles.bat –delete –profileName profile
  • On UNIX/Linux: was_install_dir/bin/manageprofiles.sh –delete –profileName profile

Ensure that references to the deleted profile are removed from the profile registry by running the following command:

  • On Windows: was_install_dir\bin\manageprofiles.bat –validateAndUpdateRegistry
  • On UNIX/Linux: was_install_dir/bin/manageprofiles.sh –validateAndUpdateRegistry

Delete the profile directory tree (if it was not deleted by the previous action).
Delete the profile Directory using one of these commands:

  • On Windows: was_install_dir\profiles\rmdir /s profileDirectory
  • On UNIX/Linux: was_install_dir\profiles\rm -R profileDirectory

Websphere - Windows service for Nodeagent, AppSrv creating example

Creating Service for Application Server (JVM):
WASService.exe -add ServiceNameAppSrv01 -serverName server1 -profilePath c:\IBM\WebSphere\AppServer\profiles\AppSrv01

Creating Service for Nodeagent:
WASService.exe -add ServiceNameNodeAgent01 -serverName nodeagent -profilePath c:\IBM\WebSphere\AppServer\profiles\CustomNode01

Deleting service:
WASService.exe -remove SrvNameAppSrv01
or
WASService.exe -remove ServiceNameNodeAgent01

How to Delete a Windows Service

Deleting a Service

The first thing you’ll need to do is identify the name of the service, so open up Services through the start menu or control panel, and then find the service in the list that you want to delete.


You’ll want to open up the properties by double-clicking on the service name, and then highlight the “Service name” value and copy it to the clipboard. This is what we’ll need to disable it.


You’ll need to open up a command prompt, you’ll need to right-click the command prompt and choose Run as Administrator. We’ll use the sc command to actually do the work.

The syntax used to delete a service is this:

sc delete ServiceName

If your service name has spaces in it, you’ll need to wrap the service name in quotes, like this:

sc delete “Adobe LM Service”

2/18/2015

Maximo and Websphere 8.5.5 - Did you forget the plug-in configuration?

You've downloaded and installed WebSphere 8.5.5, the IHS and the Plugin. You have everything up and running, Maximo deployed and want to use the web server to access Maximo or load balance to multiple JVM's, so why isn't it working? Why are you receiving "Page Not Found" errors? In most cases it's likely a key step was missed that is automated with the Middleware\Maximo install when using WebSphere 7, that step is the Plugin Configuration.
During the install of WebSphere 8.5.5, you may of only installed the Application Server, HTTP Server and the Plug-in files, however you also need to install the WebSphere Customization Toolbox which contains the configuration tool for the web server plug-in. Below we will go over the install and how to configure your your Plugin.

Configuring your WebSphere Plug-in for Maximo
1. The first step if you haven't already is to install the WebSphere Customization Toolbox, you can do this using the Installation Manager and the package is contained in the WebSphere Supplemental Repositories.


Configuring the WebSphere Application Servers to start when the nodeagent starts

WebSphere Application Servers

Configuring the WebSphere Application Servers to start when the nodeagent starts


1. Log into the Integrated Solutions Console.
2. Navigate to Servers > Server Types > WebSphere application servers.

Hiding Classifications And Making it Unavailable In Maximo

The following is an attempt to make classification invisible and not usable in the future.

1. Create a new user-defined field OBSOLETE for CLASSSTRUCTURE/

Go to Database Configurations – bring up object CLASSSTRUCTURE:
Switch to Attributes tab and click New Row and enter OBSOLETE as the following example:


Configure the database. Log out and log back in.

2/17/2015

Creating a Windows service for the node agent

In a network deployment configuration, you can create the node agent as a Windows service to make WebSphere® Application Server nodes easier to start and manage.

About this task

Create the node agent as a Windows service so that the node agent starts automatically when the server is rebooted. An activated node agent communicates with the cell Deployment Manager to manage the set of servers on the node.
If you do not create the node agent as a service, you must run the startNode command manually. For example: <was_home>/profiles/<profile_name>/startNode.bat.

Procedure

  1. Open a command prompt window.
  2. Change the directory to <was_home>\binFor example: type cd c:\Program Files\IBM\WebSphere\AppServer\bin
  3. Type the following WASService command with the following parameters (case-sensitive, without the line breaks):
    WASService -add <profile_name>_nodeagent -serverName nodeagent -profilePath 
    "<was_home>\profiles\<profile_name>" -wasHome 
    "<was_home>" -logRoot 
    "<was_home>\profiles\<profile_name>\logs\nodeagent" -logFile 
    "<was_home>\profiles\<profile_name>\logs\nodeagent\startServer.log" 
    -restart true
    -startType automatic
    Where
    <was_home>
    Specifies the directory where WebSphere Application Server is installed. For example: C:\Program Files\IBM\WebSphere\AppServer
    <profile_name>
    Specifies the name of the custom node profile in Windows service. For example: Custom01.
    Example (with sample values)
    WASService -add Custom01_nodeagent -serverName nodeagent -profilePath "c:\Program Files\IBM\WebSphere\AppServer\profiles\Custom01" -wasHome"c:\Program Files\IBM\WebSphere\AppServer" -logRoot "C:\Program Files\IBM\WebSphere\AppServer\profiles\Custom01\logs\nodeagent" -logFile"C:\Program Files\IBM\WebSphere\AppServer\profiles\Custom01\logs\nodeagent\startServer.log" -restart true -startType automatic
  4. Press Enter. For example: The last line of the screen is displayed.
    IBM WebSphere Application Server V7.0 - Custom01_nodeagent service successfully 
    added.
  5. Close the command prompt.
  6. Verify that the service is added to Windows services.
    1. Click Start > Run. Type services.msc.
    2. Verify that the node agent service is displayed. For example:IBM WebSphere Application Server v7.0 - Custom01_nodeagent.
  7. Optional: If you have additional nodes, repeat this task for other nodes in your cluster. For example: Custom02.

Results

You added the node agent service to the list of Windows services.

2/01/2015

Maximo Integration Framework (MIF). Which Components to Use?

How do I determine which integration components to use for my integration scenario?
This is a common question for those who are not familiar with the I-F.  Reasons for choosing the use of certain I-F components is often decided based on one or more of the following:
  1. The integration capabilities of the application being integrated to Maximo
  2. The integration skills of the developers who will implement the integration
  3. The need to have the integration processing occur in a synchronous or asynchronous manner
  4. What level of error management is required and what level is supported by the external application
  5. Do integration messages need to process based on events (ie. approval of a Work Order)
  6. Does the integration need to operate in a batch or real-time (near) mode.
  7. Is the I-F being used to support implementation data loading
  8. Will the integration be deployed using a common ESB layer within your enterprise
The above list is not intended to be all-inclusive, but it should give you an idea of the types of things to consider when planning integration with Maximo.  Keep in mind, large integration deployments could involve many systems and require different integration components to be used for different external applications.

1/27/2015

CI Classification - Export to XLS

CI classification with attributes names: Link to XLS file

SQL Query script:
select
main.classificationid CIROOT, main.classstructureid CI_ID,
chold1.classificationid CH1, chold1.classstructureid CH1_ID,
chold2.classificationid CH2, chold2.classstructureid CH2_ID,
chold3.classificationid CH3, chold3.classstructureid CH3_ID,
chold4.classificationid CH4, chold4.classstructureid CH4_ID,
CASE WHEN chold4.classstructureid is not NULL THEN chold4.classstructureid
ELSE CASE WHEN chold3.classstructureid is not NULL THEN chold3.classstructureid
ELSE CASE WHEN chold2.classstructureid is not NULL THEN chold2.classstructureid
ELSE CASE WHEN chold1.classstructureid is not NULL THEN chold1.classstructureid END END END
END CHECK_ID,
specification.assetattrid SPEC_ATTR
from classstructure main
left join classstructure chold1 on chold1.parent = main.classstructureid
left join classstructure chold2 on chold2.parent = chold1.classstructureid
left join classstructure chold3 on chold3.parent = chold2.classstructureid
left join classstructure chold4 on chold4.parent = chold3.classstructureid
left join classspec specification on specification.classstructureid = (CASE WHEN chold4.classstructureid is not NULL THEN chold4.classstructureid
ELSE CASE WHEN chold3.classstructureid is not NULL THEN chold3.classstructureid
ELSE CASE WHEN chold2.classstructureid is not NULL THEN chold2.classstructureid
ELSE CASE WHEN chold1.classstructureid is not NULL THEN chold1.classstructureid END END END
END)
where main.classificationid = 'CIROOT'
order by CIROOT, CH1, CH2, CH3, CH4, SPEC_ATTR

For update data from your database you need to update your connection settings:

1/20/2015

Good news for Report Developers who cannot execute reports using BIRT Report Viewer on Internet Explorer 11 (Win 8.1)

To resolve the issue of blank window when I try to execute report using BIRT Report Viewer on Internet Explorer 11, I do next steps:
  1. Run regedit.exe
  2. Open "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeaturControl\FEATURE_BROWSER_EMULATION"
  3. Add "DWORD (32-bit) Value": "jawaw.exe=9000" (https://flic.kr/p/pVA62s)
  4. At the end of elipse.ini add following entry:
-Dorg.eclipse.swt.browser.DefaultType=ie
-Dorg.eclipse.swt.browser.IEVersion=9999
(https://flic.kr/p/pVP4zx)

Run eclipse.exe, execute report. I have following result: https://flic.kr/p/qA1Ztj

1/13/2015

Conditional user interface in SmartCloud Control Desk 7.5.1

IBM Support Portal: http://goo.gl/fXhKO5

Email Listener Communications via GMail


Email Listener Communications via GMail - Part I: Importing the SSL Certificate


A Note About SSL Certificates

In general, SSL certificates are acquired from certificate authorities.  The implementation of certificates falls in the province of the email server and application server.  Maximo does not directly (or even indirectly) handle or access SSL certificates.  The request for an SSL enabled connection is via a property issued to the JavaMail API.  Certificate handling occurs between the application server's JavaMail API and trust store and the email server.

Importing an SSL Certificate into Websphere 

In this case we'll be using GMail over SSL.  Websphere provides a handy feature for pulling the SSL certificate from the email server.
  • Log into the Websphere console
  • Navigate to Security > SSL certificate and key management > under Related Items select Key stores and certificates > CellDefaultTrustStore > under Additional Properties select Signer certificates
  • Click on Retrieve from port                       
     Host:    smtp.gmail.com
     Port:     465
     Alias:    gmail (or desired alias)   



Email Listener Communications via GMail - Part II: Configuring SMTP Over SSL


System Properties

Below are the properties that will be used to connect to GMail via SMTP.  Note that the property 'mail.smtp.ssl.enable' has been added to allow authentication via SMTP over SSL.


Enabling the properties may require a full restart of the Websphere server instance hosting IBM Maximo 7.5.0.3.
 
Note: In this article only two GMail addresses will be used (servreq.user and servreq.listener).  The account servreq.listener will be used to authenticate with the SMTP server.  Your IBM Maximo system may have separate accounts for SMTP authentication and the listener.
 
Testing the SMTP Connection 
 
The SMTP connection can be quickly validated by resetting a user's password.


If mail.debug is enabled, the complete communication stream between the JavaMail API and the email server will be visible in the SystemOut log.  In this snippet the SMTP connection over SSL is apparent:
 
<snip> 
O DEBUG SMTP: useEhlo true, useAuth true
O DEBUG SMTP: useEhlo true, useAuth true
O DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL true
O 220 mx.google.com ESMTP c17sm12626936vdj.11
O DEBUG SMTP: connected to host "smtp.gmail.com", port: 465
</snip> 
 
User PETE has received his new password via GMail.


Email Listener Communications via GMail - Part III: Sending Service Requests


Create an Email Listener

Using the out-of-the-box workflow process (LSNRBP), an Email Listener is created and activated which connects to the GMail pop server using pop3s.



Fire Up GMail and 'Talk' to the Listener

Our Service Request user is having printer difficulties so he drafts an email describing the issue using the GMail web client and sends it to the Maximo Email Listener's address.


The SR acknowledgement is received from Maximo a few moments later.


The resolver logs into Maximo and views their new Service Request which was created from an email received via GMail over SSL.