Showing posts with label IBM Maximo. Show all posts
Showing posts with label IBM Maximo. Show all posts

Thursday, 8 August 2024

Asset Deletion Query Sql | IBM Maximo

To delete asset totally from system including all related tables in Maximo System.

Single Asset Delete Query Example:

delete from AMCREWTOOL where ASSETNUM='WAP-0071';
delete from AMCREWWOTL  where ASSETNUM='WAP-0071';
delete from AREASAFFECTED where AFFECTEDASSETNUM='WAP-0071';
delete from ASSET  where ANCESTOR='WAP-0071';
delete from ASSET  where ASSETNUM='WAP-0071';
delete from ASSET  where PARENT='WAP-0071';
delete from ASSET where PLUSTALIAS='WAP-0071';
delete from ASSETANCESTOR  where ANCESTOR='WAP-0071';
delete from ASSETANCESTOR  where ASSETNUM='WAP-0071';
delete from ASSETAUDIT  where ASSETNUM='WAP-0071';
delete from ASSETCALIBRATION  where ASSETNUM='WAP-0071';
delete from ASSETFEASPECHIST  where ASSETNUM='WAP-0071';
delete from ASSETFEATURE  where ASSETNUM='WAP-0071';
delete from ASSETFEATUREHIST  where ASSETNUM='WAP-0071';
delete from ASSETFEATURESPEC  where ASSETNUM='WAP-0071';
delete from ASSETHIERARCHY  where ASSETNUM='WAP-0071';
delete from ASSETHIERARCHY  where PARENT='WAP-0071';
delete from ASSETHISTORY  where ASSETNUM='WAP-0071';
delete from ASSETLOCCOMM  where ASSETNUM='WAP-0071';
delete from ASSETLOCRELATION  where SOURCEASSETNUM='WAP-0071';
delete from ASSETLOCRELATION  where TARGETASSETNUM='WAP-0071';
delete from ASSETLOCRELHIST  where SOURCEASSETNUM='WAP-0071';
delete from ASSETLOCRELHIST  where TARGETASSETNUM='WAP-0071';
delete from ASSETLOCUSERCUST  where ASSETNUM='WAP-0071';
delete from ASSETMETER  where ASSETNUM='WAP-0071';
delete from ASSETMNTSKD  where ASSETNUM='WAP-0071';
delete from ASSETOPSKD  where ASSETNUM='WAP-0071';
delete from ASSETSPEC  where ASSETNUM='WAP-0071';
delete from ASSETSPECHIST  where ASSETNUM='WAP-0071';
delete from ASSETSTATUS  where ASSETNUM='WAP-0071';
delete from ASSETTOPOCACHE  where SOURCEASSETNUM='WAP-0071';
delete from ASSETTOPOCACHE  where TARGETASSETNUM='WAP-0071';
delete from ASSETTRANS  where ASSETNUM='WAP-0071';
delete from ASSETTRANS  where FROMPARENT='WAP-0071';
delete from ASSETTRANS  where TOPARENT='WAP-0071';
delete from ASSETWORKZONE  where ASSETNUM='WAP-0071';
delete from AUTOATTRUPDATE where ASSET='WAP-0071';
delete from CI  where ASSETNUM='WAP-0071';
delete from COLLECTDETAILS  where ASSETNUM='WAP-0071';

Thursday, 13 January 2022

Delete Outbound Error Messages from Message Reprocessing Application | IBM Maximo


Deleting error messages requires two actions. 

First the DELETEFLAG must be set to 1, then the status changed to RETRY. 

Both of these are done transparently when deleting a message in the Message Reprocessing application. In an escalation they must be done in the correct order.

Warning: Be very careful when using this escalation to delete held messages. If valid transactions are sent in while this escalation is active, and they fail due to a correctable error, they can be deleted.

In the Escalations application, create a new escalation.

Applies To: MAXINTERROR

Condition: status=status='HOLD' and queuename = 'jms/maximo/int/queues/sqout'

Add an escalation point and check the Repeat box.

Add an action. Use the lookup arrow to Go To the Actions app to create the Action.

Create a new Action with the following values:

Object: MAXINTERROR

Type: Set Value

Value: 1

Parameter/Attribute: DELETEFLAG

Save and Return with Value to the Escalations application.

Thursday, 11 February 2021

Overdue Duration Calculation Between Two Dates (Excluding Weekends) using Automation Scripts | Maximo

We have two dates, the status date: rcareviewdate and Etc date:rcainprgdate. The script below calculates the duration in Hours excluding weekends between these two dates based on attribute status date change. 

When we change the status it will calculate overdue for previous status ETC date and current status change date.

Launch Point Type:     Attribute Launch Point

Attribute:                     CHANGEDATE

  #Imports


from java.util import Date 

from java.text import SimpleDateFormat

from psdi.mbo import MboConstants 

from psdi.server import MXServer

from java.util import Calendar

from psdi.app.common import DateUtility



#Milliseconds Constants

MILLISECONDS_DAY= 86400000 

MILLISECONDS_HOUR = 3600000

MILLISECONDS_MINUTE = 60000 


#Default hours and minutes values

days = 0

hours = 0

minutes = 0 

Monday, 4 January 2021

Create Purchase Requisition from Inventory Usage using Action Script (Customized Option) | IBM Maximo

Recently we had the requirement to disable the direct MR to PR automation. so instead of

creating direct PR from MR, the users will select a store on material requisition to reserve material

from store. When the MR is approved, the inventory usage is created from MR.

If the material is available in-store, storeroom will issue the material otherwise he clicks the option

to create Purchase Requisition (PR) from inventory usage.

So we developed this new functionality.

Note: This script contains a few custom attributes. I have commented those line, In your case please remove them.

Step 1:

First Add new Status for Inventory Usage Application: PR_CREATED

Step 2: Create Automation Script

Launch Point:        ACTION

Object:                  INVUSE

Variable:                v_mr

Binding Value:      INVUSELINE[MRNUM is null].MRNUM*

Relations:              INVUSE --> INVUSELINE -->MRNUM (child object:MR, mrnum=:mrnum)

Thursday, 24 December 2020

Reassign Workflow Assignments in Bulk using Escalation | IBM Maximo

Sometimes you have the requirement of reassignment of 200-300 workflow assignments for users.

You can reassign the workflow assignments using an Escalation based on the WFAssignment object. In this example, we will reassign all of Umar's (personid=116524) WF Assignments for application to Qadeer. To do all of Umar's assignments, not just the specific application assignments, leave off the "app =" parameter used below. 

Condition:

WFID != 0 and assignstatus = 'ACTIVE' and assigncode = '116524' and app = 'SR'

Create escalation point bute Leave all the escalation point fields empty. Repeat is off

Create and Attach Action:

Create an action on the same object with set Value of replacement user's assigncode.

Sunday, 20 December 2020

Workflow Handling from Automation Script | IBM Maximo

Initiate a workflow from an Automation Script. 

from psdi.server import MXServer

mxs = MXServer.getMXServer()

wfstart = mxs.lookup('WORKFLOW')

wfstart.initiateWorkflow('CSPREIMB',mbo)

 

-------------------------

Or define a function in your script and call it whenever needed as below:

Function Defination:

def startwf(a):
   actionSet = MXServer.getMXServer().getMboSet("action", a.getUserInfo());
   sqf = SqlFormat("action = :1")
   sqf.setObject(1, "action", "action", "STWFEUNRI")
   actionSet.setWhere(sqf.format())
   actionSet.reset()
   actionSet.getMbo(0).executeAction(a)

 

Function Call:

startwf(MboVariable)

 2. Stop an active workflow from the Automation Script. 

from psdi.server import MXServer

mxs = MXServer.getMXServer().lookup('WORKFLOW') 

wfstop = mxs.getActiveInstances(mbo)

         wfstart.getMbo(0).stopWorkflow('Stopped')

 or 

    wfInstanceSet=mbo.getMboSet("$wfInstanceSet","WFINSTANCE","processname='IBMMAINWF' and ownertable='WORKORDER' and ownerid=:workorderid and active=1")

wfInstanceMbo=wfInstanceSet.moveFirst()

if wfInstanceMbo:

        wfInstanceMbo.stopWorkflow("Stopped because Type becomes DLP")


Invoke Action from Automation Script | IBM Maximo

from psdi.common.action import Action, ActionRemote

from psdi.security import UserInfo

from psdi.server import MXServer


mxServer = MXServer.getMXServer()

userInfo = mbo.getUserInfo()


actionSet = mxServer.getMboSet("ACTION", userInfo)

actionSet.reset()

actionSet.setWhere("action = 'INV_RUN_REP'")


if(not actionSet.isEmpty()):

action = actionSet.getMbo(0)

action.executeAction(mbo)

actionSet.close()

Tuesday, 15 September 2020

Automation for Restriction on Increasing PO Quantity for the PO Revision but Allow the Quantity Decrease || IBM Maximo

Recently we had a requirement of Increasing the PO quantity on the PO revision but allow the quantity increase. So, We used the automation script getPreviousValue() and getCurrentValue() functions in order to resolve this requirement.

Create Database Error Message on Database Config Application.

Object :         POLINE

Attribute:      ORDERQTY

Events:          Validate

Type:             Attribute Type Launch Point

Body:

Thursday, 3 September 2020

How Maximo Populates Lead Attribute of Person Group on Work Order Application || IBM Maximo

  • Lead is inherited from PM if defined in PM.
  • Group Default Person in Person Group is selected based on person calendar availability between work order target start and complete dates of attached "Calendar/ Shift".
  • The alternate person will be populated if group default is not available.
  • if alternate is also not available, Lowest person  in the sequence of person group with calendar availability will be populated .
  • The Calendar and shifts should be properly applied.

Saturday, 15 August 2020

Conditional Lookup Functionality for List View Search using Automation Script isZombie() Method || IBM Maximo

Recently we had a requirement of conditional lookup for Maximo list view search. We have a custom column called sub-work type which is based on the value selected on the main work type attribute. This functionality on the application was working fine using table domain but it wasn't working on the list view in Maximo.

SO we developed a solution using conditional lookup automation script in Maximo list view search fields. First, we got the where clause of the current APP from memory in wclause variable, and then we got the work type i.e. CM or PM value using the split function. Then by using the zombie() method we set the work type value for a list where clause.

Object

WORKORDER

Type

ATTRIBUTE LAUNCH POINT (Jython)

Attribute

WOSUBTYPE

Name

WOSUBTYPE

Body

from psdi.common.context import UIContext

appName = mbo.getThisMboSet().getParentApp()

if appName in ('PLUSPWO','PLUSPWOCMP'):

#Get Where clause for list view search

    wclause = service.webclientsession().getCurrentApp().getResultsBean().getMboSet().getUserAndQbeWhere() 

 #Search worktype value of list view

    if mbo.isZombie():

         clause=wclause.split("worktype")[1].split("'")[1]

         listWhere="worktype='"+clause+"'"

Thursday, 21 May 2020

Maximo product configuration matrix | IBM Maximo


A configuration matrix for Maximo. New product versions are released and tested on an ongoing basis. So  below is the link for IBM Maximo configuration Matrix that can help build and configure environment in complicated environments.

Configuration Matrix will give you understanding of installation and configuration of IBM Maximo patches, hot fixes, add-ons and versions compatibility as well.



 https://www.ibm.com/support/pages/maximo-product-configuration-matrix

Thanks

Sunday, 10 May 2020

Creation of Yes / No User Input Dialog Validation for Custom Status using Automation Script || IBM Maximo

Today we are going to show you the creation of user user input dialog box for the custom status field. We have a custom application which has the custom status field, it changes the status of work order tasks based on this custom status. The requirement came when there was no validation when the user changed the status. We will show you how created validation dialog box using automation script.


1. Go to Database Configuration and create a message for user input

      Message Group:  os_taskstatus

      Message Key:      os_taskstatus

      Value:                Do you really want to change the status?

      Buttons:              Yes, No


2. Create Automation Script:

      Launch Point:    Attribute

      Events:          Validate

      Object:               WOACTIVITY

      Attribute:            ZZOSACTIVITYSTATUS

      Script:                  Jython

Tuesday, 21 January 2020

Maximo DocInfo Inbound Processing | IBM Maximo

Create Maximo automation script for inbound document transaction from external system.

--create script for integration
--select enterprise service
--select service name
--SYNC.NPP_DOCINFO.EXTEXIT.IN

from com.ibm.tivoli.maximo.util.mbo import IterableMboSet
from java.math import BigDecimal


from java.io import File
from java.rmi import RemoteException
from psdi.mbo import *
from psdi.util import MXException
from psdi.app.doclink import Docinfo
from psdi.app.doclink import DocinfoSet
from psdi.app.doclink import DocinfoSetRemote
from psdi.app.doclink import DoclinksSetRemote
from java.lang import SecurityException
import sys


erData.breakData()

docinfoid = erData.getCurrentData("DOCINFOID")
dociset = MXServer.getMXServer().getMboSet("DOCINFO",MXServer.getMXServer().getUserInfo('MAXADMIN'))
dociset.setWhere("docinfoid="+str(docinfoid))
dociset.reset()
contentuid = dociset.moveFirst().getString("CONTENTUID")

erData.setCurrentData("CONTENTUID",contentuid)


# Code to delete the file from server
URLTYPE = dociset.moveFirst().getString("URLTYPE");
if (URLTYPE=='FILE'):
    URLNAME = dociset.moveFirst().getString("URLNAME");
    print('**** deletefilefromserver... ')
    deletefile = File(URLNAME)
    if (deletefile.exists()):
        print('**** Deleting file... '+URLNAME)
        deletefile.delete()
        print('**** File Deleted... '+URLNAME)



Saturday, 15 December 2018

Part 2. Create Condition Monitoring and Enter Meter Reading Values Using Rest API | IBM Maximo

In the previous post, we created meters and attached meters to asset. Today we will create condition monitoring record and enter meter values using Rest Api.

1. First step is to create object structure MX-MEASUREPOINT1. Add MEASUREPOINT object to it and add a child object of CHARPOINTACTION.
Object Location Path: MEASUREPOINT/CHARPOINTACTION
Relation: CHARPOINTACTION.

2. Create a new HTML file and paste a following code:
<html>
<body>
<form name="input" action="http://maxhostname:9080/maxrest/rest/os/MX-MEASUREPOINT1?_lid=wilson&_lpwd=wilson" method="POST">
    POINTNUM      <input name="POINTNUM" value="1111" type="text"> <p/>
    ASSETNUM                <input name="ASSETNUM" value="11245" type="text"> <p/>
    SITEID          <input name="SITEID" value="BEDFORD" type="text"> <p/>
    DESCRIPTION          <input name="DESCRIPTION" value="Vibration check" type="text"> <p/>
    MEASUREPOINTID     <input name="MEASUREPOINTID" value="" type="number"> <p/>
    METERNAME             <input name="METERNAME" value="VIBRATION1" type="text"> <p/>
    CHARPOINTACTIONID       <input name="CHARPOINTACTION.ID1.CHARPOINTACTIONID" value="" type="number"> <p/>
    VALUE <input name="CHARPOINTACTION.ID1.VALUE" value="High" type="text"> <p/>
    JPNUM      <input name="CHARPOINTACTION.ID1.JPNUM" value="JP-111" type="text"> <p/>
    PRIORITY <input name="CHARPOINTACTION.ID1.PRIORITY" value="" type="text"> <p/>
<input type="submit" value="Submit">
</form>
</body>

Monday, 30 July 2018

Maximo Asset Management 7.6.1 Released | IBM Maximo

IBM released Maximo 7.6.1 on 27 July, 2018. Here is a sneak preview of what users can expect in Maximo 7.6.1.
New features and capabilities will help your organization achieve greater asset management efficiency through improvements in usability, integration, installation, and business intelligence.




What’s New in Maximo 7.6.1?


Tuesday, 29 May 2018

Workflow Migration From Source to Target Environment Using Migration Manager | IBM Maximo

Migration Manager migrates configuration content from one product environment to another. You typically migrate configuration content from a development environment to a test environment and then to a production environment.
After you develop and configure your applications, you can migrate the configurations to a test environment. After testing the configurations, you can migrate them to a production environment. By using Migration Manager, you can migrate iterative configuration changes in a planned and controlled manner.
To migrate the configuration content, you organize it into packages. The packages go through a series of steps that make up the migration process. Some steps occur in the originating environment, called the source environment, and some steps occur in the destination environment, called the target environment.

We will take the example of simple workflow migration for basic understanding of migration manager.

Workflow Migration:

Source Server Steps:

  • Goto > System Configuration > Migration > Migration Groups




















  • Create New Migration Group and enter Name, Description
  • Select desired Object Structures to migrate, in this case we are going to migrate a workflow, for that object structure selected here is DMWFPROCESS.

Thursday, 24 May 2018

Reprocessing Interface Table Errors MEA (Maximo Enterprise Adapter for Oracle Applications) | IBM Maximo

When an error occurs in an Maximo outbound transaction, the adapter stops processing the transaction and updates the interface table status columns with information about the error. There is no user interface for correcting errors in the Maximo Asset Management interface tables, so you must update the record directly with a SQL tool.

Interface Table Status:
Every outbound interface table contains the following columns, which contain information about the status of the transaction:
OA_IFACESTATUS: The status of the transaction. It has three types:

1. DONE: The transaction was successful.
2. WARNING: The data was transferred but a problem was encountered.
3. ERROR: Due to a system or data error, the data transfer did not occur. Check OA_IFACEMESSAGE for error messages.

OA_IFACETIMESTAMP: The date and time the transaction completed or failed.

OA_IFACEMESSAGE: A general message about errors.

The triggers, which reside on the outbound interface tables, are of trigger type before insert or update. Therefore, directly updating the interface table transactions ensures that the transaction is processed.
Triggers do not exist for the inbound enterprise services. These processes are asynchronous and the integration framework retrieves the records.
The following steps describe how to update an outbound transaction with an error in the interface table, then send the transaction to the Oracle open interface tables again.

Friday, 4 May 2018

Attached Docs Edit Restriction When Record Is Not In Workflow Assignment Using Automation Script | IBM Maximo

Its a continuation from my last post in which a record is not in certain user's assignment, then it cannot be edited. Only assigned user can edit that record.
But there is one problem, the users cannot edit PR record but they can edit attached docs associated with corresponding record and it doesn't apply on attached documents. Because technically, the attach docs object is different.
We have implemented this requirement with different object event condition (using doclinks, pr and wfassignment objects) using automation script on Purchase Requisitions Application.

Object Launch Point :  DOCLINKS

Script : Jython

Object Event Condition: 

(select count(ownerid) from wfassignment where ownertable='PR' and assignstatus='ACTIVE'
AND ownerid in (select prid from pr where prid =:ownerid) )>0
and
(select count(ownerid) from wfassignment where ownertable='PR' and assignstatus='ACTIVE'
and assigncode IN (:&USERNAME&) AND ownerid in (select prid from pr where prid =:ownerid) )=0

Events: Save, Add, Update, Delete, Before Save

Thursday, 3 May 2018

Deny Users From Editing Application Record if It's Not In Their Workflow Assignment Using Automation Script | IBM Maximo

One of the requirements we get that in a active workflow process, if a record is not in certain user's assignment, then it cannot be edited. Only assigned user can edit that record. We have implemented this requirement using automation script on Purchase Requisitions Application.

Object Launch Point :  PR

Script : Jython

Object Event Condition: 
(select count (ownerid) from wfassignment where ownertable='PR' and assignstatus='ACTIVE'
AND ownerid in (select prid from pr  where prnum=:prnum))>0
and
(select count(ownerid) from wfassignment where ownertable='PR' and assignstatus='ACTIVE'
and assigncode in (:&USERNAME&) and ownerid in (select prid from pr  where prnum=:prnum))=0

Events: Save, Add, Update, Before Save

Saturday, 27 January 2018

Keyboard Shortcuts | IBM Maximo

You can use a combination of keys to perform an action without using a mouse. 

Standard keyboard shortcuts

You can navigate among and within the applications by using a combination of keys. You can use the following keyboard shortcuts to navigate the application screens.
ActionKeyboard shortcut
Move from one interface element to the next.Tab key
Select buttons, links, and menu options.Enter key
Select or clear a check box.Spacebar
Display field help for field in focus.Alt+F1
Keyboard shortcuts for global navigation
Link nameKeyboard shortcut
BulletinsAlt+B
Go ToAlt+G
ReportsAlt+R
Start CenterAlt+C
ProfileAlt+P
Sign OutAlt+S
HelpAlt+H
ReturnAlt+R
Return with ValueAlt+W