├── .travis.yml ├── README.md └── samples ├── AS01_scheduleDates.md ├── AS02_makeWorkFlow.md ├── AS03_01_poreccomm.md ├── AS03_notifyUsers.md ├── AS04_workflowcondition.md ├── AS05_useSequence.md ├── AS06_dateCalculationP1.md ├── AS06_dateCalculationP2.md ├── AS06_dateCalculationP3.md ├── AS07_executeReport.md ├── AS07_executeReport_ReportExecution.md ├── AS08_emailListener.md ├── AS09_businessRule.md ├── AS10_creatingAS.md ├── AS11_importExportScripts.md ├── original ├── AS01_Autoscript for setActualDates when comp wo.doc ├── AS02_Automation Script to make WF follow Status privileges as defined by Security Groups.docx ├── AS03_01_poreccomm.md ├── AS03_Notify Users of Material and Service Receipts.docx ├── AS04_worklog condition.doc └── AS05_use sequence and not autokey(1).doc ├── sample01 ├── SP01.png ├── SP02.png └── SP03.png ├── sample02 ├── Picture1.png ├── Picture2.png ├── Picture3.png ├── Picture4.png ├── Picture5.png ├── Picture6.png └── Picture7.png ├── sample03 └── poreccomm.py ├── sample04 ├── pic1.png ├── pic2.png ├── pic3.png ├── pic4.png └── pic5.png ├── sample05 ├── pic1.png ├── pic2.png ├── pic3.png ├── pic4.png ├── pic5.png └── pic6.png ├── sample06-1 ├── datedifference.py ├── pic1.jpeg ├── pic2.jpeg ├── pic3.jpeg └── pic4.jpeg ├── sample06-2 ├── pic1.jpeg ├── pic2.jpeg ├── pic3.jpeg ├── pic4.jpeg ├── pic5.jpeg └── pic6.jpeg ├── sample07 ├── 75_schedulingreports_with_automation_scripts.pdf ├── POscript.py ├── pic1.png ├── pic2.png ├── pic3.png ├── pic4.png ├── pic5.png └── pic6.png ├── sample08 ├── lsnrwoact.pdf ├── pic1.png ├── pic2.png ├── pic3.png ├── pic4.png ├── pic5.png └── pic6.png ├── sample09 ├── pic1.jpeg └── pic2.jpeg ├── sample10 ├── pic01.gif ├── pic02.gif ├── pic03.gif ├── pic04.gif ├── pic05.gif ├── pic06.gif ├── pic07.gif ├── pic08.gif ├── pic09.gif ├── pic10.gif ├── pic11.gif ├── pic12.gif ├── pic13.gif ├── pic14.gif ├── pic15.gif ├── pic16.gif ├── pic17.gif ├── pic18.gif ├── pic19.gif └── pic20.gif └── sample11 ├── compsetactualdates.dbc ├── convert.bat ├── convert.sh ├── convertint.bat ├── convertint.sh ├── pic1.png └── pic2.jpg /.travis.yml: -------------------------------------------------------------------------------- 1 | group: travis_latest 2 | language: python 3 | cache: pip 4 | matrix: 5 | allow_failures: 6 | - python: 2.7 7 | - python: 3.7 8 | include: 9 | - python: 2.7 10 | #- python: 3.4 11 | #- python: 3.5 12 | #- python: 3.6 13 | - python: 3.7 14 | dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069) 15 | sudo: required # required for Python 3.7 (travis-ci/travis-ci#9069) 16 | install: 17 | # - pip install -r requirements.txt 18 | - pip install flake8 19 | before_script: 20 | # stop the build if there are Python syntax errors or undefined names 21 | - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics 22 | # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide 23 | - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics 24 | script: 25 | - true # add other tests here 26 | notifications: 27 | on_success: change 28 | on_failure: change # `always` will be the setting once code changes slow down 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Maximo automation scripting 2 | 3 | This document is a **Work in Progress** 4 | 5 | This document is not intended to be a substitute for the official Maximo API documentation. If any contradiction is present, you must consider the official documentation as the source of truth. 6 | 7 | You must have a basic knowledge about Maximo Asset Management and development, mainly Java, XML and HTTP requests. You must be also familiar with Maximo applications and modules. 8 | 9 | ## About the Maximo automation scripting repository 10 | 11 | Welcome to the Maximo automation scripting repository. Join us and use this technical repository to share ideas, solutions, and problems with other Maximo developers. The goal of this repository is for users to learn and share customizations that use scripting in Maximo Asset Management. 12 | 13 | NOTE: This repository is not intended to act as a communication channel to Maximo Support regarding defects. Use the normal support channels for reporting defects. 14 | 15 | It is important to note that automation scripts are custom code. Support does not engage in writing scripts or debugging custom scripts. Any atuomation scripts that are provided in this repository by IBM or others are intended to be samples and are not supported by IBM. 16 | 17 | ## About Maximo automation scripts 18 | 19 | An automation script consists of a launch point, variables that have corresponding binding values, and the source code. You use wizards to create the components of an automation script. You create automation scripts and launch points or you create a launch point and associate the launch point with an existing automation script. 20 | 21 | ### Prerequisite skills 22 | 23 | To automate tasks, you must have knowledge in the following areas: 24 | 25 | * Scripting language syntax and operations 26 | * Product configurations, such as workflow processes, escalations, and actions 27 | * Application data models and relationships 28 | 29 | Experience with Maximo® business object (MBO) API is an advantage although not a prerequisite. 30 | 31 | ### Components of automation scripts 32 | 33 | For an automation script to run, you specify the following components: 34 | 35 | * A launch point that defines the context for the script to run 36 | * Variables and corresponding binding values 37 | * Source code written in a supported scripting language 38 | 39 | ### Launch point 40 | 41 | A launch point defines the execution context for an automation script, for example when a business object is updated or a value is entered into a field. Some types of launch point are supported and the Automation Scripts application provides a separate wizard application for creating each type of launch point. 42 | 43 | ### Variables and binding values 44 | 45 | You can specify the variables that determine how information is passed into or received from an automation script in the wizard applications. Variables are not mandatory, but when you use variables it simplifies the amount of code that is written and makes it easier to reuse the code. 46 | 47 | ### Source code 48 | 49 | You can write source code in an external application and import it into the Automation Scripts application. Alternatively, you can enter code directly into the **Source Code** field in the wizard applications. The source code must be written in the languages that are supported by the following script engines: 50 | 51 | Mozilla Rhino, version 1.6 release 2 52 | Jython, version 2.5.2 53 | 54 | 55 | ## Environment prerequisites 56 | 57 | You must have an active Maximo user account to use these APIs. 58 | 59 | ## Getting Start with Maximo automation scripting 60 | 61 | This section is intended to get you started with the basics of automation scripts, including which application to use, which fields to use, and how you can run your automation scripts. 62 | 63 | ## Maximo automation scripts 64 | 65 | Automation scripts are small, targeted pieces of code that can be authored, saved, and instantly activated in a Tivoli's Process Automation Engine-based product environment to extend the product. Automation scripts were first introduced with the 7.5 release of Tivoli's Process Automation Engine. Since this release, the capability has been welcomed and adapted by clients and implementers as an accelerated approach to implementing the desired solution. 66 | 67 | This README.MD document serves as a landing page for learning and experimenting with automation scripts. Links will be added to other sources of automation script information that may be published by IBM or the broader user community. Examples of scripting will be listed here over time. 68 | 69 | ## Maximo Automation Scripting & Sample Packages 70 | 71 | The following recipes can help you get started with automation scripts: 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 83 | 84 | 85 | 86 | 89 | 90 | 91 | 92 | 95 | 96 | 97 | 98 | 101 | 102 | 103 | 104 | 107 | 108 | 109 | 110 | 113 | 114 | 115 | 116 | 123 | 124 | 125 | 126 | 129 | 130 | 131 | 132 | 135 | 136 | 137 | 138 | 141 | 142 | 143 | 144 | 147 | 148 |
Sample IDSample Description & Sample Link
01 81 | Creating and import an automation script 82 |
02 87 | Automation script that sets actual dates from scheduled dates when a work order is completed. 88 |
03 93 | Automation script makes the workflow follow the status privileges that are defined by Security Groups 94 |
04 99 | Notify users of material and service receipts 100 |
05 105 | Worklog condition 106 |
06 111 | Use sequence instead autokeyn 112 |
07 117 | Date Calculation - Part 1 118 |
119 | Date Calculation - Part 2 120 |
121 | Date Calculation - Part 3 122 |
08 127 | Scripting report execution 128 |
09 133 | Extending email listener by using scripting 134 |
10 139 | Turning off a Maximo built-in business rule by using scripting 140 |
11 145 | How to import/export an automation script into a .dbc file. 146 |
149 | 150 | ## Maximo automation scripting official documentation: 151 | 152 | [Official Documentation - Maximo Automation Scripting 7.5](https://www.ibm.com/support/knowledgecenter/SSLKT6_7.5.0.5/com.ibm.mbs.doc/autoscript/t_ctr_automate_routine_app_tasks.html) 153 | 154 | [Official Documentation - Maximo Automation Scripting 7.6](https://www.ibm.com/support/knowledgecenter/SSLKT6_7.6.0/com.ibm.mbs.doc/autoscript/t_ctr_automate_routine_app_tasks.html) 155 | 156 | ## Document references 157 | 158 | [IBM developerWorks](https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20Maximo%20Asset%20Management/page/Customizing%20with%20automation%20scripts) 159 | 160 | [Scripting with Maximo Wiki](https://www.ibm.com/developerworks/community/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/scripting_with_maximo6?lang=en) 161 | 162 | [Scripting with Maximo.pdf](https://www.ibm.com/developerworks/community/forums/ajax/download/77777777-0000-0000-0000-000014772567/b8ec7d85-6a8d-4e25-bb89-d729c3322406/attachment_14772567_Scripting_with_Maximo.pdf) 163 | 164 | [Collection of Automation Scripts for Maximo](https://www.ibm.com/developerworks/community/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/My_Collection_of_Automation_Scripts?lang=en) 165 | ## Important references 166 | 167 | NOTE: Scripts are pieces of code. Products that are based on Tivoli's Process Automation Engine version 7.5 ship Jython and JavaScript engines to support automation scripts. The ability to use the right syntax and develop programming logic is a prerequisite to using automation scripts. These links provide significant details and examples on basic programming with Jython and JavaScript. 168 | 169 | [Jython Tutorial](http://www.jython.org/docs/tutorial/indexprogress.html) 170 | 171 | [Rhino JavaScript Documentation](https://developer.mozilla.org/en-US/docs/Rhino_documentation) 172 | 173 | Automation scripting is built on top of the Java JSR-223 standard for using scripting languages in a Java Virtual Machine. This link provides the specification details for the JSR-223 standard. 174 | 175 | [JSR-223 specification](https://jcp.org/en/jsr/detail?id=223) 176 | -------------------------------------------------------------------------------- /samples/AS01_scheduleDates.md: -------------------------------------------------------------------------------- 1 | # Automamtion script to set actual dates from scheduled dates when a work order is completed 2 | 3 | ## Setup: 4 | 5 | 1. In Maximo Asset Management, open the Automation Scripts application and create a script by selecting the **Create Script** action.. 6 | 2. From the menu, select the **Create > Script with Attribute Launch Point** action and specify the following information: 7 | ..* **Object** field: WORKORDER 8 | ..* **Atribute** field: STATUS 9 | ..* **Variable** field: status 10 | 11 | 12 | Automation Scripting - Schedule Dates 13 | 14 | 15 | Click **Next**. 16 | 17 | 3. In the script name field, enter COMPSETACTUALDATES. This name is used in the documentation for the [Import/Export an Automation Script](samples/AS11_importExportScripts.md) sample. 18 |
19 | 20 | 4. In the **Source Code** field, enter the following code and, if necessary, edit the term "COMP" to match the term that you use for the completed status: 21 | 22 | ```python 23 | ... 24 | if status=='COMP': 25 | mbo.setValue("ActStart", mbo.getDate("SchedStart") ) 26 | mbo.setValue("ActFinish", mbo.getDate("SchedFinish") ) 27 | ... 28 | ``` 29 | 30 |
31 | Automation Scripting - Schedule Dates 32 |
33 | 34 | To verify that the automation script works, in the Work Order Tracking application, change the status to complete. The actual dates should be set to scheduled dates: 35 | 36 | 37 |
38 | Automation Scripting - Schedule Dates 39 |
40 | -------------------------------------------------------------------------------- /samples/AS02_makeWorkFlow.md: -------------------------------------------------------------------------------- 1 | # Automation Script to make workflows follow the status privileges that are defined by security groups 2 | 3 | The default behavior of a workflow is to ignore security group privileges for status changes and other options. If a user who does not have the approval privilege for work orders set in the Security Groups application gets a work order that needs routed to them in a workflow, the workflow will ignore the fact that the user does not have the approval privilege and allow the user to approve the work order. Maximo Asset Management operates this way because the designer of the workflow process specifically sent the work order to this user for approval, so the approval is allowed. This behavior also allows Maximo administrators the flexibility to remove the change status privileges from the users so that they cannot change the status in the Work Order Tracking application but still can change the status by using a workflow. 4 | 5 | This automation script changes that default behavior. When this script is in place and active, a workflow will only allow the user to change the status if they have that status privilege granted to them in the Security Groups application. This script only changes the default behavior for status changes. The workflow will still ignore other Security Group provileges, such as creating a work order and allowing a user who does not have access to the Work Order Tracking application to create a work order in a workflow using the CREATEWO action. 6 | 7 | 1. Create an automation script that has an attribute launch point. This example uses a purchase order for the object and status for the attribute. 8 | 9 |
10 | Automation Scripting - Creating WorkFlow 11 |
12 | 13 | 14 | 2. Name the script. This example uses the name WFSTATUS. 15 |
16 | Automation Scripting - Creating WorkFlow 17 |
18 | 19 | 3. Paste the following code into the **Source Code** field: 20 | 21 |
22 | Automation Scripting - Creating WorkFlow 23 |
24 | 25 | Script Source: 26 | ```kotlin 27 | from psdi.mbo import MboConstants 28 | if not interactive and mbo.isModified("status") and onupdate: 29 | newstatus = mbo.getString('status') 30 | mbo.setValue('status', status_previous, MboConstants.NOACCESSCHECK | MboConstants.NOVALIDATION_AND_NOACTION) 31 | mbo.canChangeStatus(newstatus) 32 | mbo.setValue('status', newstatus, MboConstants.NOACCESSCHECK | MboConstants.NOVALIDATION_AND_NOACTION) 33 | ``` 34 | 35 | 36 | This example code adds the status privilege checking while in a work flow to purchase orders. 37 | 4. Optional: To add the code to an additional object, such as purchase requests, add an additional launch point on the **List** tab. Select the **Create > Script with Attribute Launch Point** action. After you specify the launch point information, select the radio button for using an existing script, specify the script name, WFSTATUS, and click **Next**: 38 |   39 |
40 | Automation Scripting - Creating WorkFlow 41 |
42 | 43 | 5. Click **Next** on Step 2 of the wizard and **Create** on Step 3 of the wizard. No changes are required for these steps. 44 | 45 | ### Automation Script tab: 46 | 47 |
48 | Automation Scripting - Creating WorkFlow 49 |
50 | 51 | ### Variables tab: 52 | 53 |
54 | Automation Scripting - Creating WorkFlow 55 |
56 | 57 | 58 | ### Launch Points tab (make one launch point for each object, such as PO or WO, that uses this script): 59 | 60 |
61 | Automation Scripting - Creating WorkFlow 62 |
63 | 64 | -------------------------------------------------------------------------------- /samples/AS03_01_poreccomm.md: -------------------------------------------------------------------------------- 1 | # Automation script to create a custom action launch point 2 | 3 | ## Custom action launch point: PORECCOMM 4 | Called from Escalation PORECESC com.ibm.tivoli.maximo.script.ScriptAction 5 | PORECCOMM,PORECCOMM,PORECCOMM 6 | PO.LASTRECDATE is a custom attribute to reflect latest receipt date (MATREC or SERVREC) 7 | 8 | This sample script was written for Maximo Asset Management version 7.5.0.10. 9 | 10 | import java 11 | 12 | ```python 13 | 14 | from java.util import Calendar 15 | from java.util import Date 16 | from psdi.server import MXServer 17 | from psdi.mbo import MboConstants 18 | from psdi.mbo import MboSet 19 | from com.ibm.tivoli.maximo.util.mbo import IterableMboSet 20 | servDT = MXServer.getMXServer().getDate() 21 | df = java.text.SimpleDateFormat("MM/dd/yy kk:mm") 22 | dfnow = java.text.SimpleDateFormat("kk:mm:s:S") 23 | today = MXServer.getMXServer().getDate() 24 | now = dfnow.format(today) 25 | today = df.format(today) 26 | 27 | ``` 28 | 29 | ```python 30 | 31 | def log(e): print str(now) + ": "+str(launchPoint)+("__>> %s" % e) + "\r\n" 32 | print "*************" 33 | log("buffer") 34 | log("Entering Script:....."+str(now)) 35 | 36 | s_poNum = str(mbo.getString("PONUM") or None) 37 | s_poDesc = str(mbo.getString("DESCRIPTION") or None) 38 | s_poVend = str(mbo.getString("VENDOR.NAME") or None) 39 | s_poType = str(mbo.getString("POTYPE") or None) 40 | b_hasReceipts,b_sendComm = (False,)*2 41 | h_tableBody = "" 42 | d_lastRecDate = mbo.getDate("LASTRECDATE") or None # Custom attribute to display and reference on PO 43 | if(d_lastRecDate is None): d_lastRecDate = mbo.getDate("STATUSDATE") 44 | d_lastRec = d_lastRecDate 45 | d_newLastRec = d_lastRec 46 | 47 | ``` 48 | # Some substitution variables to use in HTML 49 | 50 | ```python 51 | 52 | h_left = " style=""text-align:left;""" 53 | h_size = " style=""font-size:90%;""" 54 | h_htmlHead = "" 55 | h_htmlFoot = "" 56 | h_tableBody = "" 57 | h_poHead = "

The following has been received from "+str(s_poVend)+" on PO:"+str(s_poNum)+"

"+str(s_poDesc)+"

" 58 | h_tableHead = "ItemDescriptionQuantity" 59 | h_tableFoot = "
" 60 | h_message = h_htmlHead 61 | ``` 62 | 63 | # Defining the sendComm function 64 | 65 | ```python 66 | 67 | def sendComm(s_templateId,s_subject,h_message): 68 | whereclause = "TEMPLATEID = '"+str(s_templateId)+"'" 69 | ctMboSet = mbo.getMboSet("$commtemp","COMMTEMPLATE",whereclause); 70 | ctMboSet.setQbeExactMatch("true") 71 | ctMboSet.reset() 72 | ctMbo = ctMboSet.getMbo(0) 73 | if(ctMbo is not None): 74 | ctMbo.setValue("SUBJECT",s_subject, MboConstants.NOACCESSCHECK | MboConstants.NOVALIDATION_AND_NOACTION) 75 | ctMbo.setValue("MESSAGE",h_message, MboConstants.NOACCESSCHECK | MboConstants.NOVALIDATION_AND_NOACTION) 76 | ctMbo.sendMessage(mbo,mbo); 77 | return 78 | 79 | s_matRecSql = " ponum = '"+s_poNum+"' and receiptref is NULL and issuetype = 'RECEIPT' and transdate > '"+str(d_lastRec)+"' " 80 | matRecSet = mbo.getMboSet("$MATREC$","MATRECTRANS",s_matRecSql) 81 | log("matRecSet.count(): "+str(matRecSet.count())) 82 | if(matRecSet.count() > 0): 83 | b_hasReceipts = True 84 | matRec = matRecSet.moveFirst() 85 | while(matRec is not None): 86 | d_mrTransDate = matRec.getDate("TRANSDATE") 87 | if(d_mrTransDate > d_newLastRec): d_newLastRec = d_mrTransDate 88 | s_toStoreLoc = matRec.getString("TOSTORELOC") or None 89 | if(s_toStoreLoc is None and s_poType == "STD"): 90 | s_itemNum = matRec.getString("ITEMNUM") or None 91 | s_itemDesc = (matRec.getString("DESCRIPTION") or None)[:65] 92 | s_itemQty = str(matRec.getFloat("QUANTITY")) 93 | b_sendComm = True 94 | h_tableBody = h_tableBody + ""+str(s_itemNum)+""+str(s_itemDesc)+""+str(s_itemQty)+"" 95 | matRec = matRecSet.moveNext() 96 | 97 | 98 | s_servRecSql = " ponum = '"+s_poNum+"' and receiptref is NULL and issuetype = 'RECEIPT' and transdate > '"+str(d_lastRec)+"' " 99 | servRecSet = mbo.getMboSet("$SERVREC$","SERVRECTRANS",s_servRecSql) 100 | log("servRecSet.count(): "+str(servRecSet.count())) 101 | if(servRecSet.count() > 0): 102 | b_hasReceipts = True 103 | servRec = servRecSet.moveFirst() 104 | while(servRec is not None): 105 | d_srTransDate = servRec.getDate("TRANSDATE") 106 | if(d_srTransDate > d_newLastRec): d_newLastRec = d_srTransDate 107 | if(s_poType == "STD"): 108 | b_sendComm = True 109 | s_servDesc = (servRec.getString("DESCRIPTION") or None)[:65] 110 | s_servQty = str(servRec.getFloat("QUANTITY")) 111 | h_tableBody = h_tableBody + "SERVICE"+str(s_servDesc)+""+str(s_servQty)+"" 112 | servRec = servRecSet.moveNext() 113 | 114 | 115 | log("*********") 116 | log("b_hasReceipts: "+str(b_hasReceipts)) 117 | log("b_sendComm: "+str(b_sendComm)) 118 | 119 | 120 | 121 | if(b_hasReceipts): 122 | log("Set PO.LASTRECDATE") 123 | mbo.setValue("LASTRECDATE",d_lastRec,MboConstants.NOACCESSCHECK | MboConstants.NOVALIDATION_AND_NOACTION) 124 | if(b_sendComm): 125 | log("Send Communication") 126 | s_templateId = "PORECEIPT" 127 | s_subject = "Receipts on PO: "+s_poNum+" "+str(df.format(d_lastRec)) 128 | # Build HTML for message 129 | h_message = h_message+h_tableHead+h_tableBody+h_htmlFoot 130 | sendComm(s_templateId,s_subject,h_message) 131 | 132 | log("Exiting Script") 133 | log("buffer") 134 | ``` 135 | 136 | ### SQL to prepare the environment to allow the automation scripting to work for this function 137 | 138 | ```sql 139 | 140 | V_PORECEIPTS 141 | create view dbo.v_poreceipts (siteid,orgid,itemnum,description,glcreditacct,gldebitacct,issuetype,linecost,linetype,transid,mrlinenum,mrnum,polinenum,ponum,porevisionnum,quantity,receivedunit,refwo,remark,requestedby,status,transdate,unitcost,receiptref,owner,invoicenum,tostoreloc,packingslipnum,issue) as 142 | 143 | (SELECT mr.siteid,mr.orgid,mr.itemnum,mr.description,mr.glcreditacct,mr.gldebitacct,mr.issuetype,mr.linecost,mr.linetype,mr.matrectransid 'transid', 144 | mr.mrlinenum,mr.mrnum,mr.polinenum,mr.ponum,mr.porevisionnum,mr.quantity,mr.receivedunit,mr.refwo, 145 | mr.remark,mr.requestedby,mr.status,mr.transdate,mr.unitcost,mr.receiptref,'MATRECTRANS',mr.invoicenum,mr.tostoreloc,mr.packingslipnum,mr.issue 146 | FROM matrectrans mr 147 | UNION ALL 148 | SELECT sr.siteid,sr.orgid,'Service',sr.description,sr.glcreditacct,sr.gldebitacct,sr.issuetype,sr.linecost,sr.linetype,sr.servrectransid 'transid',sr.mrlinenum, 149 | sr.mrnum,sr.polinenum,sr.ponum,sr.porevisionnum,sr.quantity,pol.orderunit,sr.refwo,sr.remark,pol.requestedby, 150 | sr.status,sr.transdate,sr.unitcost,sr.receiptref,'SERVRECTRANS',sr.invoicenum,NULL,NULL,1 151 | FROM servrectrans sr LEFT JOIN poline pol ON sr.ponum = pol.ponum AND sr.polinenum = pol.polinenum AND sr.porevisionnum = pol.revisionnum) 152 | 153 | V_MX_PORECEIPTS 154 | create view dbo.v_mx_poreceipts (siteid,orgid,itemnum,description,glcreditacct,gldebitacct,issuetype,linecost,linetype,transid,mrlinenum,mrnum,polinenum,ponum,porevisionnum,quantity,receivedunit,refwo,remark,requestedby,status,transdate,unitcost,receiptref,owner,invoicenum,tostoreloc,packingslipnum,issue) as 155 | SELECT siteid,orgid,itemnum,description,glcreditacct,gldebitacct,issuetype,linecost,linetype,transid,mrlinenum,mrnum,polinenum,ponum,porevisionnum,quantity,receivedunit,refwo,remark,requestedby,status,transdate,unitcost,receiptref,owner,invoicenum,tostoreloc,packingslipnum,issue FROM v_poreceipts 156 | 157 | UPDATE po 158 | SET po.ns_lastrecdate = 159 | isnull( (SELECT isnull(max(por.transdate),po.statusdate) 160 | FROM v_poreceipts por 161 | WHERE por.ponum = po.ponum 162 | AND por.receiptref is NULL 163 | AND por.issuetype = 'RECEIPT' 164 | GROUP by por.ponum) ,po.statusdate) 165 | WHERE po.receipts <> 'NONE' 166 | ``` 167 | -------------------------------------------------------------------------------- /samples/AS03_notifyUsers.md: -------------------------------------------------------------------------------- 1 | # Notify users of material and service receipts 2 | 3 | You can create an automation script that can notify users of receipts in an email, without sending a separate email for each receipt record. This process uses an escalation to activate a custom action to do send the notification. 4 | 5 | ## Prerequirements: 6 | 7 | This automation script was developed on Maximo Asset Management version 7.5.0.10 and SQL Server. 8 | 9 | 10 | ## Note: 11 | 12 | This automation script works only for purhcase orders where all lines are requested by the same user. 13 | 14 | ## Step 1 15 | 16 | Create a persistent attribute that is named PO.LASTRECDATE (DATETIME 10). 17 |
    18 |
  • Optionally, add the attribute to the **List** and **Main** tabs for purchase orders. 19 |
  • Turn off Admin mode. 20 |
21 | 22 | ## Step 2 23 | 24 | Create a role that is named POREQ and specify the following information for the role: 25 |
    26 |
  • Type: Data Related to the Record 27 |
  • Object: PO 28 |
  • Value: :poline.requestedby 29 |
30 | 31 | ## Step 3 32 | 33 | Create a communication template that is named PORECEIPT and specify the following information for the template: 34 |
    35 |
  • Applies To: PO 36 |
  • Subject and Message are customizable for your business needs. 37 |
  • Add the POREQ role as a recipient. 38 |
  • Activate the template. 39 |
40 | 41 | 42 | ## Step 4 43 | 44 | Create a custom launch point that is named PORECCOMM and specify the following information: 45 |
    46 |
  • Object: PO 47 |
  • Action: PORECCOMM 48 |
  • Bound Variables: None 49 |
  • Source: See the poreccomm.py script. It is also available at this link. 50 |
51 | 52 | ## Step 5 53 | 54 | Create an action group that is named PORECESC and specify the following information. 55 |
    56 |
  • Object: PO 57 |
  • Type: Action Group 58 |
  • Members: PORECCOMM 59 |
60 | 61 | ### Additional information: 62 | 63 | You can create new views on the database that are independent of Maximo Asset Management. 64 | 65 | * The following sample code can be used to update all PO records: 66 | 67 | ```kotlin 68 | V_PORECEIPTS 69 | ``` 70 | * The following sample code can also be used to update the V_MX_PORECEIPTS view: 71 | ```kotlin 72 | V_MX_PORECEIPTS (extra credit) 73 | ``` 74 | * The following sample code can be used as an imported Maximo object that combines MATREC and SERVREC by PO: 75 | 76 | PORECCOMM Script 77 | 78 | ## Step 6 79 | 80 | Create an escalation that is named PORECESC and specify the following information. 81 | 82 |
    83 |
  • Applies To: PO 84 |
  • Condition: 85 |
86 | 87 | ```sql 88 | 89 | po.historyflag = 0 AND po.receipts <> 'NONE' 90 | AND (exists (SELECT 1 FROM matrectrans mr WHERE mr.ponum = po.ponum AND mr.receiptref is NULL AND mr.issuetype = 'RECEIPT' AND mr.transdate > isnull(po.ns_lastrecdate,po.orderdate)) 91 | OR exists (SELECT 1 FROM servrectrans sr WHERE sr.ponum = po.ponum AND sr.receiptref is NULL AND sr.issuetype = 'RECEIPT' AND sr.transdate > isnull(po.ns_lastrecdate,po.orderdate))) 92 | 93 | ``` 94 | 95 | • Escalation Point: repeats 96 | • Action Group: PORECESC 97 | • Don’t forget to activate this SQL code. 98 | 99 | ## Sample script 100 | 101 | The following code contains the entire sample script for this scenario. 102 | PORECCOMM Script 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /samples/AS04_workflowcondition.md: -------------------------------------------------------------------------------- 1 | # Automation script for a condition that is based on work log information 2 | 3 | This script returns a value of true or false based on the log type that is defined in a custom condition in the Conditional Expression Manager. 4 | 5 | ### Step 1 6 | 7 | In the Automation Scripts application, select the **Create > Script with an Object Launch Point** action. 8 | 9 | * On the **Automation Script** tab, copy and paste the following script source: 10 | ```kotlin 11 | if logtype == 'WORK': 12 | evalresult=True 13 | else: 14 | evalresult=False 15 | ``` 16 | 17 | [Work Flow Condition](sample04/pic1.png) 18 | 19 | ### Step 2 20 | 21 | * On the **Variables** tab, fill in the Script field with WORKLOGCOND variable name and uses the jython script as the Script Language to be used. Also, the Variable Type field must be IN and The Building Type value must as ATTRIBUTE, as shown in the following image: 22 | 23 | 24 | [Work Flow Condition](sample04/pic2.png) 25 | 26 | ### Step 3 27 | 28 | * On the **Launch Points** tab, verify the following values are specified: 29 | - In the **Script** field: WORKLOGCOND 30 | - In the **Script Language** field: jython 31 | - In the **Status** field: Draft 32 | Ensure that the launch point is listed in the "Launch Point" section, as shown in the following image: 33 | 34 | [Work Flow Condition](sample04/pic3.png) 35 | 36 | * In the "Custom Condition Launch Point" section, select the **Active** checkbox to TRUE and, in the ATTRIBUTE field, specify LOGTYPE. Then, click **OK** to proceed. 37 | 38 | [Work Flow Condition](sample04/pic4.png) 39 | 40 | ### Step 5 41 | 42 | * In the Conditional Expression Manager, create the condition by adding a row where the **Condition** field refers to LOGTYPE and the **Class** field contains the CLASS type. Also, in **Expression** field, paste in the following code: 43 | 44 | ```SQL 45 | worklogcond:worklogcond 46 | ``` 47 | The (Full Qualifiend Name) (FQN) of the Script Custom Condition class is given, and the **Class** field contains the following Java Type: 48 | 49 | ```java 50 | com.ibm.tivoli.maximo.script.ScriptCustomCondition 51 | ``` 52 | 53 | [Work Flow Condition](sample04/pic5.png) 54 | 55 | * The script verifies the values and returns a value of true or false. 56 | -------------------------------------------------------------------------------- /samples/AS05_useSequence.md: -------------------------------------------------------------------------------- 1 | # Automation script to use a sequence instead of an autokey 2 | 3 | This script allows for the current unique id sequence to be used to set the record key value instead of using an autokey. Launch points can be created for various objects, such as work orders and tickets, and still use the same script. You can remove the autokey from the field in question. This example uses the **Reported By field** for the launch point, and it is recommended that you use the script for fields that do not require user entry. The script can further be expanded to process differently by site or based on the interactive flag. 4 | 5 | 6 | 7 | ### Step 1: Automation Script tab 8 | In the Automation Scripts application, select the **Create > Script with an Attribute Launch Point** action and paste the following script into the **Source Code** field on the **Automation Script** tab 9 | 10 | ```python 11 | key=str(id) 12 | ``` 13 | [Use Sequence](sample05/pic1.png) 14 | 15 | ## Step 2: Variables tab 16 | 17 | On the **Variables** tab, in the Variables section, expand the parentval variable and fill in the **Variable Type** field with the value IN. 18 | 19 | [Use Sequence](sample05/pic2.png) 20 | 21 | Find the variable key, exapnd it and fill in the **Variable Type** field with the value INOUT. 22 | 23 | [Use Sequence](sample05/pic3.png) 24 | 25 | Also, find the variable id, exapnd it and fill in the **Variable Type** field with the value INOUT, as shown in the following image: 26 | 27 | [Use Sequence](sample05/pic4.png) 28 | 29 | 30 | ## Step 3: Launch Points tab 31 | 32 | On the **Launch Point** Tab, verify that the launch point USESEQWO is listed and activated in the Launch Point section. 33 | 34 | [Use Sequence](sample05/pic5.png) 35 | 36 | Also, at the Attribute Launch Point section, verify that the **Attribute** field is set to REPORTEDBY value and tjat the variables are listed into the Launch Point Variables, as shown in the following image: 37 | 38 | [Use Sequence](sample05/pic6.png) 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /samples/AS06_dateCalculationP1.md: -------------------------------------------------------------------------------- 1 | # Calculating elapsed time based on date and time measurements in Maximo business objects 2 | 3 | ## Introduction 4 | 5 | Many Maximo business objects, processes, and applications record date and time measurements. Such measurements can be used to compute the total time spent by operators on particular tasks. For example, in the Service Request application, finding the elapsed time difference between Actual Finish and Actual Start date and time can help measure the time spent by service desk agents in completing and closing a ticket. This computed information can then be used in ad hoc reporting to gain insights into the efficiency of the service desk. 6 | 7 | ## Date and time processing with scripts 8 | 9 | You want to calculate the elapsed time and show it in the Service Request application user interface formatted in an easy-to-read manner. For example, if the Actual Start time for a service request was 9/2/04 12:04 PM and the Actual Finish time was 9/2/04 12:14 PM, then the time spent in resolving the service request is 10 minutes. 10 | 11 | Note: In Maximo Asset Management, the time that is spent on a service request is tracked by labor transaction records. These records are generated whenever a service desk agent starts a timer and then stops it, which captures the time spent. An agent may also manually enter Actual Start and Finish information directly into the service request record. Various totals for a service request can be viewed under different categories, such as Total Labor Hours and Total Costs. 12 | 13 | ## Requirements for the scenario 14 | 15 | The following actions are required for the scenario 16 | 17 | * Add a persistent attribute TIMESPENT to the TICKET business object 18 | * Modify the Service Request presentation to show a Time Spent field 19 | * Create an Object launch point for the Service Request business object. This launch point is executed whenever an existing service request record is modified. 20 | * Create a Jython script that is associated with the object launch point. This script performs the elapsed time computation. 21 | 22 | TIMESPENT attribute 23 | 24 | The purpose of this attribute is to save the computed elapsed time in an end-user-friendly format in the product database. In the Database Configuration application ,create the persistent TIMESPENT attribute for the TICKET business object. The data type is ALN, and its length is 20 characters. Configure the product so that this new attribute takes effect. The attribute is inherited by the SR business object. 25 | 26 | [Calculation](sample06-1/pic1.jpeg) 27 | 28 | SR application presentation 29 | 30 | In the Application Designer, open the SR application presentation. Locate the Dates section on the **Service Request** tab. Add a text box below the **Actual Finish** field. Configure the text box by binding the field with the TIMESPENT attribute of the SR business object. In the Textbox Properties dialog box, specify a label and select the SR.TIMESPENT attribute by using the Attribute lookup. Save the presentation. 31 | 32 | [Calculation](sample06-1/pic2.jpeg) 33 | 34 | Object Launchpoint 35 | 36 | In the Automation Scripts application, select the **Create > Script with Object Launch Point** to open the wizard. 37 | 38 | In Step 1 of the wizard, provide the following values: 39 | 40 | Launch Point: CALCELAPSEDTIME 41 | Object: SR 42 | Active: Checked 43 | Update: Checked 44 | 45 | In Step 2 of the wizard, provide the following values: 46 | 47 | 48 | Script: CALCELAPSEDTIME 49 | Script Language: jython 50 | Log Level: ERROR 51 | Input variable ‘actualfinish’, bound to SR.ACTUALFINISH attribute 52 | Input variable ‘actualstart’, bound to SR.ACTUALSTART attribute 53 | Output variable ‘timespent’, bound to SR.TIMESPENT attribute 54 | 55 | In Step 3 of the wizard, provide the following script: 56 | ```java 57 | timediff = actualfinish - actualstart 58 | 59 | timespent = elapsedtime(msdiff) 60 | ``` 61 | In Step 3 of the wizard, click the **Create** button to create the object launch point and save the script. 62 | 63 | ## Troubleshooting with Dates 64 | 65 | To test this configuration, open the Service Requests application, select a service request record that is in the RESOLVED state and has an actual start and finish date and time. Edit the long description and save the record. The following error is displayed: 66 | 67 | ```kotlin 68 | BMXAA7837E - An error occured that prevented the CALCELAPSEDTIME script for the CALCELAPSEDTIME launch point from running. 69 | TypeError: unsupported operand type(s) for -: 'java.sql.Timestamp' and 'java.sql.Timestamp' in 53 | 54 | -------------------------------------------------------------------------------- /samples/sample11/convert.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | SETLOCAL 4 | 5 | call commonEnv.bat 6 | 7 | set JAVA_HOME=..\..\java\jre 8 | 9 | rem Command line parameters are as follows 10 | rem -s represents source. Valid values are 11 | rem OS - Object Structure 12 | rem PH - Publish Channel 13 | rem ES - Enterprise Service 14 | rem IC - Invocation Channel 15 | rem WS - Web Service Registry 16 | rem EP - End Point 17 | rem EX - External System 18 | rem TABLE - Table 19 | rem BYOS - All objects for the Object Structure (have to have same where caluse) 20 | rem -n represents name (os name, es name, interaction name, table name ...). For multiple names use "," separation 21 | rem -x represents external system name (for es and ph). 22 | rem -w represents where clause (for table and byos). 23 | rem -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 24 | rem -p represents the password - value must be the password to access the e-mail account 25 | rem -p represents the tenant code - value must be the tenant code for consultant users in MT 26 | rem -u represents the user - value must be a valid e-mail account name 27 | rem -h represents host name (if not used will use localhost) 28 | rem -a represents use header. Do you want to create sigoption header. If multiple interaction for one application. Header need to be created only once 29 | rem -r name of resource type when creating JSON resource (if specified resourcetype statemens will be created. Specify 0 if you do npot want to create resource type) 30 | rem -y add delete statement before insert 31 | rem -g for SIGOPTION grant application name 32 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sOS -nMXAPIASSET -y1 -fendpoint.dbc -umxintadm -pmxintadm -hlocalhost -t00 33 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sPH -nMXPOInterface,MXPRInterface -xEXTSYS1 -ftest.dbc -uwilson -pwilson -hlocalhost -t00 34 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sES -nIOTFASSET -xIOTFSYNC -fiotf.dbc -y1 -uwilson -pwilson -hlocalhost -t00 35 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sEX -nIOTFSYNC -fiotf.dbc -uwilson -y1 -pwilson -hlocalhost -t00 36 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sWS -nMXPO -ftest.dbc -uwilson -pwilson -hlocalhost 37 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sEP -nMXXMLFILE -ftest.dbc -uwilson -pwilson -hlocalhost 38 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sINT -nECRI -a0 -fecri1.dbc -uwilson -pwilson 39 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nAPPLICATIONAUTH -w"app='MXAPIWODETAIL' and optionname = 'INSERT'" -y1 -d1 -fauth.dbc -uwilson -pwilson -hlocalhost 40 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nIOTFCFG -w"1=1" -y1 -fyajin1.sql -uwilson -pwilson -hlocalhost 41 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nIOTFDEVICEMAPPING -w"1=1" -y1 -fyajin2.sql -uwilson -pwilson -hlocalhost 42 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sBYOS -nMXJSONMAPPING -w"mapname='WEATHERALERT'" -y1 -d0 -fmap.dbc -uwilson -pwilson -hlocalhost 43 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sBYOS -nMXOPERLOC -wsiteid='BEDFORD' -d0 -floc.sql -uwilson -pwilson -hlocalhost 44 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sJSONRES -nHISTORIAN -fhist.dbc -y1 -uwilson -pwilson 45 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sJSONMAP -nLAYER16IN -flayer16.dbc -y1 -uwilson -pwilson 46 | 47 | 48 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nASSETATTRIBUTE -w"assetattrid = 'MFGLIFE'" -y1 -d1 -fattr.dbc -uwilson -pwilson -hlocalhost 49 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sBYOS -nMXCLASSIFICATION -w"classstructureid = '157937'" -y1 -d1 -fspec.dbc -uwilson -pwilson -hlocalhost 50 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nMAXRELATIONSHIP -w"name in ('TEMPMETER', 'MFGLIFE')" -y1 -d1 -frel.dbc -uwilson -pwilson -hlocalhost 51 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nQUERY -w"clausename in ('Bad Actor - LTD Cost', 'METERSALARMLEVEL')" -y1 -d1 -fquery.dbc -uwilson -pwilson -hlocalhost 52 | 53 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCATIONS -w"location like 'PUMPHOUSE%%'" -y1 -d1 -floc.dbc -uwilson -pwilson -hlocalhost 54 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCATIONS -w"location like 'WELL FIELD%%'" -y1 -d1 -floc1.dbc -uwilson -pwilson -hlocalhost 55 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCATIONS -w"location = 'TWC'" -y1 -d1 -floc2.dbc -uwilson -pwilson -hlocalhost 56 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCOPER -w"location like 'PUMPHOUSE%%'" -y1 -d1 -flocoper.dbc -uwilson -pwilson -hlocalhost 57 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCOPER -w"location like 'WELL FIELD%%'" -y1 -d1 -flocoper1.dbc -uwilson -pwilson -hlocalhost 58 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCOPER -w"location = 'TWC'" -y1 -d1 -flocoper2.dbc -uwilson -pwilson -hlocalhost 59 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nMAXENDPOINTDTL -w"endpointname = 'IOTHISTCLOUD'" -y1 -d1 -fdet.dbc -uwilson -pwilson -hlocalhost 60 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCHIERARCHY -w"systemid = 'WATER'" -y1 -d1 -flochier.dbc -uwilson -pwilson -hlocalhost 61 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCSTATUS -w"location like 'PUMPHOUSE%%'" -y1 -d1 -flocstat.dbc -uwilson -pwilson -hlocalhost 62 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCSTATUS -w"location like 'WELL FIELD%%'" -y1 -d1 -flocstat1.dbc -uwilson -pwilson -hlocalhost 63 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCSTATUS -w"location = 'TWC'" -y1 -d1 -flocstat2.dbc -uwilson -pwilson -hlocalhost 64 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nLOCSYSTEM -w"systemid = 'WATER'" -y1 -d1 -flocsys.dbc -uwilson -pwilson -hlocalhost 65 | 66 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nASSET -w"assetnum like 'AH%%'" -y1 -d1 -fasset.dbc -uwilson -pwilson -hlocalhost 67 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nASSETSPEC -w"assetnum like 'AH%%'" -y1 -d1 -fassetspec.dbc -uwilson -pwilson -hlocalhost 68 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nASSETSPECHIST -w"assetnum like 'AH%%'" -y1 -d1 -fassethist.dbc -uwilson -pwilson -hlocalhost 69 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sTABLE -nASSETMETER -w"assetnum like 'AH%%'" -y1 -d1 -fassetmeter.dbc -uwilson -pwilson -hlocalhost 70 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sSTART -ftest.dbc -uwilson -pwilson -hlocalhost 71 | rem %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sEND -nALL -y1 -d1 -fsteve.dbc -uwilson -pwilson -hlocalhost 72 | -------------------------------------------------------------------------------- /samples/sample11/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./commonEnv.sh 4 | 5 | export JAVA_HOME="../../java/jre" 6 | 7 | # Command line parameter are as follows 8 | # -s represents source. Valid values are 9 | # OS - Object Structure 10 | # PH - Publish Channel 11 | # ES - Enterprise Service 12 | # IC - Invocation Channel 13 | # WS - Web Service Registry 14 | # EP - End Point 15 | # EX - External System 16 | # TABLE - Table 17 | # BYOS - All objects for the Object Structure (have to have same where caluse) 18 | # WC - All objects to create new work center (the data does not need to exist in Maximo) 19 | # -n represents name (os name, es name, interaction name, table name ...). For multiple names use "," separation 20 | # -x represents external system name (for es and ph). 21 | # -w represents where clause (for table and byos). 22 | # -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 23 | # -p represents the password - value must be the password to access the e-mail account 24 | # -p represents the tenant code - value must be the tenant code for consultant users in MT 25 | # -u represents the user - value must be a valid e-mail account name 26 | # -p represents password 27 | # -h represents host name (if not used will use localhost) 28 | # -a represents use header. Do you want to create sigoption header. If multiple interaction for one application. Header need to be created only once 29 | # -r name of resource type when creating JSON resource (if specified resourcetype statemens will be created. Specify 0 if you do npot want to create resource type) 30 | # -y add delete statement before insert 31 | # -g for SIGOPTION grant application name 32 | # -b for Object Structure work center name 33 | # -i for Object Structure SIGOPTION names (supported ALL and READ) 34 | # -k for Object Structure authorization group name 35 | # -0 for Work Center all Object Structures for this work center 36 | # -v for Work Center demo user for work center 37 | 38 | # Create Object Structure and add it to work Center 39 | # -sOS represents source Object Structure. 40 | # -n represents Object Structure name name. For multiple names use "," separation 41 | # -y add delete statement before insert 42 | # -b for Object Structure work center name 43 | # -i SIGOPTION names (supported ALL and READ) 44 | # -k authorization group name (will create mxdemo group authorization) 45 | # -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 46 | # -h represents host name (if not used will use localhost) 47 | # -u represents the user - value must be a valid e-mail account name 48 | # -p represents password 49 | # -t represents the tenant code - value must be the tenant code for consultant users in MT 50 | 51 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sOS -nMXAPICRAFT -y0 -bTEST -iALL -kTEST -ftestcraft.dbc -umaxadmin -pmaxadmin -hlocalhost -t00 52 | 53 | # Create Object Structure only 54 | # -sOS represents source Object Structure. 55 | # -n represents Object Structure name name. For multiple names use "," separation 56 | # -y add delete statement before insert 57 | # -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 58 | # -h represents host name (if not used will use localhost) 59 | # -u represents the user - value must be a valid e-mail account name 60 | # -p represents password 61 | # -t represents the tenant code - value must be the tenant code for consultant users in MT 62 | 63 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sOS -nMXAPICRAFT -y0 -fapicraft1.dbc -umaxadmin -pmaxadmin -hlocalhost -t00 64 | 65 | # Create Automation script 66 | # -sSCRIPT represents source Automation script. 67 | # -n represents Automation script name name. 68 | # -y add delete statement before insert 69 | # -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 70 | # -h represents host name (if not used will use localhost) 71 | # -u represents the user - value must be a valid e-mail account name 72 | # -p represents password 73 | # -t represents the tenant code - value must be the tenant code for consultant users in MT 74 | 75 | $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sSCRIPT -n"COMPSETACTUALDATES" -y1 -fcompsetactualdates.dbc -umaxadmin -pmaxadmin -hlocalhost -t01 76 | 77 | # Create Work Center 78 | # -sWC represents source Work center (demo group name will have same name). 79 | # -b represents Work Center name. 80 | # -l Work Center description (same description will be used for demo group name) 81 | # -i for Object Structure SIGOPTION names (supported ALL and READ) 82 | # -0 all Object Structures for this work center 83 | # -v demo user for work center 84 | # -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 85 | # -h represents host name (if not used will use localhost) 86 | # -u represents the user - value must be a valid e-mail account name 87 | # -p represents password 88 | # -t represents the tenant code - value must be the tenant code for consultant users in MT 89 | 90 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sWC -bTEST -l"Test work Center" -oMXAPIPERUSER,MXAPIASSET,MXAPIDOMAIN -iALL -vtest77 -ftest1.dbc -umaxadmin -pmaxadmin -hlocalhost -t00 91 | 92 | # Create table (for maxtable and maxrelationshup it will create proper dbc statements) 93 | # -sTABLE represents source table. 94 | # -n represents table name. For multiple names use "," separation 95 | # -w represents where clause (for table and byos). 96 | # -y add delete statement before insert 97 | # -d use default date (will use current date or date from database) 98 | # -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 99 | # -h represents host name (if not used will use localhost) 100 | # -u represents the user - value must be a valid e-mail account name 101 | # -p represents password 102 | # -t represents the tenant code - value must be the tenant code for consultant users in MT 103 | 104 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCATIONS -w"location like 'PUMPHOUSE%%'" -y1 -d1 -floc.dbc -umaxadmin -pmaxadmin -hlocalhost 105 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nAUSCRIPT -w"location like 'PUMPHOUSE%%'" -y1 -d1 -floc.dbc -umaxadmin -pmaxadmin -hlocalhost -t01 106 | 107 | # Get data from all tables based on the Object Structure 108 | # -sBYOS represents source by Object Structure. 109 | # -n represents Object Structure name name. For multiple names use "," separation 110 | # -w represents where clause (where clase have to be valid for all objest in Object Structure). 111 | # -y add delete statement before insert 112 | # -d use default date (will use current date or date from database) 113 | # -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 114 | # -h represents host name (if not used will use localhost) 115 | # -u represents the user - value must be a valid e-mail account name 116 | # -p represents password 117 | # -t represents the tenant code - value must be the tenant code for consultant users in MT 118 | 119 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sBYOS -nMXCLASSIFICATION -w"classstructureid = '157937'" -y1 -d1 -fspec.dbc -umaxadmin -pmaxadmin -hlocalhost 120 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sBYOS -nWORKORDER -w "classstructureid = '157937'" -y1 -d1 -fspec_1.dbc -umaxadmin -pmaxadmin -hlocalhost 121 | 122 | # Following 2 commands let record all changes which happening between you start process and end process 123 | # -sSTART represents source Start Process. 124 | # -sEND represents source End Process. 125 | # -y add delete statement before insert 126 | # -d use default date (will use current date or date from database) 127 | # -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 128 | # -h represents host name (if not used will use localhost) 129 | # -u represents the user - value must be a valid e-mail account name 130 | # -p represents password 131 | # -t represents the tenant code - value must be the tenant code for consultant users in MT 132 | 133 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sSTART -ftest.dbc -umaxadmin -pmaxadmin -hlocalhost -t00 134 | 135 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sPH -nMXPOInterface,MXPRInterface -xEXTSYS1 -ftest.dbc -umaxadmin -pmaxadmin -hlocalhost -t00 136 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sES -nIOTFASSET -xIOTFSYNC -fiotf.dbc -y1 -umaxadmin -pmaxadmin -hlocalhost -t00 137 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sEX -nIOTFSYNC -fiotf.dbc -umaxadmin -y1 -pmaxadmin -hlocalhost -t00 138 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sWS -nMXPO -ftest.dbc -umaxadmin -pmaxadmin -hlocalhost 139 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sEP -nMXXMLFILE -ftest.dbc -umaxadmin -pmaxadmin -hlocalhost 140 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sINT -nECRI -a0 -fecri1.dbc -umaxadmin -pmaxadmin 141 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sJSONRES -nHISTORIAN -fhist.dbc -y1 -umaxadmin -pmaxadmin 142 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sJSONMAP -nLAYER16IN -flayer16.dbc -y1 -umaxadmin -pmaxadmin 143 | 144 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sBYOS -nMXJSONMAPPING -w"mapname='WEATHERALERT'" -y1 -d0 -fmap.dbc -umaxadmin -pmaxadmin -hlocalhost 145 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sBYOS -nMXOPERLOC -wsiteid='BEDFORD' -d0 -floc.sql -umaxadmin -pmaxadmin -hlocalhost 146 | 147 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nASSETATTRIBUTE -w"assetattrid = 'MFGLIFE'" -y1 -d1 -fattr.dbc -umaxadmin -pmaxadmin -hlocalhost 148 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nMAXRELATIONSHIP -w"name in ('TEMPMETER', 'MFGLIFE')" -y1 -d1 -frel.dbc -umaxadmin -pmaxadmin -hlocalhost 149 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nQUERY -w"clausename in ('Bad Actor - LTD Cost', 'METERSALARMLEVEL')" -y1 -d1 -fquery.dbc -umaxadmin -pmaxadmin -hlocalhost 150 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nMAXUSER -w"userid='MAXADMIN'" -y1 -d1 -fuser.dbc -umaxadmin -pmaxadmin -hlocalhost -t00 151 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nIOTFCFG -w"1=1" -y1 -fyajin1.sql -umaxadmin -pmaxadmin -hlocalhost 152 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nIOTFDEVICEMAPPING -w"1=1" -y1 -fyajin2.sql -umaxadmin -pmaxadmin -hlocalhost 153 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCATIONS -w"location like 'WELL FIELD%%'" -y1 -d1 -floc1.dbc -umaxadmin -pmaxadmin -hlocalhost 154 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCATIONS -w"location = 'TWC'" -y1 -d1 -floc2.dbc -umaxadmin -pmaxadmin -hlocalhost 155 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCOPER -w"location like 'PUMPHOUSE%%'" -y1 -d1 -flocoper.dbc -umaxadmin -pmaxadmin -hlocalhost 156 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCOPER -w"location like 'WELL FIELD%%'" -y1 -d1 -flocoper1.dbc -umaxadmin -pmaxadmin -hlocalhost 157 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCOPER -w"location = 'TWC'" -y1 -d1 -flocoper2.dbc -umaxadmin -pmaxadmin -hlocalhost 158 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nMAXENDPOINTDTL -w"endpointname = 'IOTHISTCLOUD'" -y1 -d1 -fdet.dbc -umaxadmin -pmaxadmin -hlocalhost 159 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCHIERARCHY -w"systemid = 'WATER'" -y1 -d1 -flochier.dbc -umaxadmin -pmaxadmin -hlocalhost 160 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCSTATUS -w"location like 'PUMPHOUSE%%'" -y1 -d1 -flocstat.dbc -umaxadmin -pmaxadmin -hlocalhost 161 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCSTATUS -w"location like 'WELL FIELD%%'" -y1 -d1 -flocstat1.dbc -umaxadmin -pmaxadmin -hlocalhost 162 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCSTATUS -w"location = 'TWC'" -y1 -d1 -flocstat2.dbc -umaxadmin -pmaxadmin -hlocalhost 163 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nLOCSYSTEM -w"systemid = 'WATER'" -y1 -d1 -flocsys.dbc -umaxadmin -pmaxadmin -hlocalhost 164 | 165 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nASSET -w"assetnum like 'AH%%'" -y1 -d1 -fasset.dbc -umaxadmin -pmaxadmin -hlocalhost 166 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nASSETSPEC -w"assetnum like 'AH%%'" -y1 -d1 -fassetspec.dbc -umaxadmin -pmaxadmin -hlocalhost 167 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nASSETSPECHIST -w"assetnum like 'AH%%'" -y1 -d1 -fassethist.dbc -umaxadmin -pmaxadmin -hlocalhost 168 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sTABLE -nASSETMETER -w"assetnum like 'AH%%'" -y1 -d1 -fassetmeter.dbc -umaxadmin -pmaxadmin -hlocalhost 169 | 170 | 171 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sEND -nALL -y1 -d1 -ftest5.dbc -umaxadmin -pmaxadmin -hlocalhost -t00 172 | # $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$MAXIMO_CLASSPATH/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sEND -nALL -y1 -d1 -ftest5.dbc -umaxadmin -pmaxadmin -hlocalhost -t00 173 | 174 | -------------------------------------------------------------------------------- /samples/sample11/convertint.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | SETLOCAL 4 | 5 | call commonEnv.bat 6 | 7 | set JAVA_HOME=..\..\java\jre 8 | 9 | rem Command line parameters are as follows 10 | rem -s represents source. Valid value is INT 11 | rem -n represents name (os name, es name ...). For multiple names use "," separation 12 | rem -a represents use header. Do you want bto create sigoption header. If multiple interaction for one application. Header need to be created only once 13 | rem -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 14 | rem -p represents the password - value must be the password to access the e-mail account 15 | rem -u represents the user - value must be a valid e-mail account name 16 | rem -h represents host name (if not used will use localhost) 17 | %JAVA_HOME%\bin\java -classpath ../classes;%MAXIMO_CLASSPATH%;.\mail.jar psdi.tools.DBCConverter -sINT -nECRI -a0 -fecri.dbc -uwilson -pwilson -------------------------------------------------------------------------------- /samples/sample11/convertint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./commonEnv.bat 4 | 5 | export JAVA_HOME="../../java/jre" 6 | export MAXIMO_CLASSPATH="../../../" 7 | 8 | echo $MAXIMO_CLASSPATH 9 | 10 | # Command line parameters are as follows 11 | # -s represents source. Valid value is INT 12 | # -n represents name (os name, es name ...). For multiple names use "," separation 13 | # -a represents use header. Do you want bto create sigoption header. If multiple interaction for one application. Header need to be created only once 14 | # -f represents file name. Must end with .ora, .sqs, .db2, .sql, .dbc. For dbc scripts use .dbc 15 | # -p represents the password - value must be the password to access the e-mail account 16 | # -u represents the user - value must be a valid e-mail account name 17 | # -h represents host name (if not used will use localhost) 18 | 19 | $JAVA_HOME/bin/java -cp "../classes:$MAXIMO_CLASSPATH:mail.jar:/$MAXIMO_CLASSPATH/applications/maximo/lib/*:/$1/applications/maximo/businessobjects/classes:." psdi.tools.DBCConverter -sINT -nECRI -a0 -fecri.dbc -umaxadmin -pmaxadmin -hlocalhost -------------------------------------------------------------------------------- /samples/sample11/pic1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-maximo-dev/maximo-scripting/3e462a7320cc9999c352dde0e746dda4f8f3843d/samples/sample11/pic1.png -------------------------------------------------------------------------------- /samples/sample11/pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-maximo-dev/maximo-scripting/3e462a7320cc9999c352dde0e746dda4f8f3843d/samples/sample11/pic2.jpg --------------------------------------------------------------------------------