from java.lang import StringBuilder
from psdi.mbo import MboConstants
from psdi.util import HTML
val = StringBuilder()
# retrieve attributes and writes them in HTML format in the buffer
#Work Order header row
val.append("<table border=0 width=500>" + "<col width=10%>" + "<col width=10%>"
+ "<col width=10%>"
+ "<thead>"
+ "<tr>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "WO Number" + "</b>" + "</font>" + "</td>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "SITE" + "</b>" + "</font>" + "</td>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "STATUS" + "</b>" + "</font>" + "</td>"
+ "</thead>"
+ "</table>")
val.append("<table border=0 width=500>" + "<col width=10%>" + "<col width=10%>"
+ "<col width=10%>"
+ "<tr>"
+ "<td width=10%><font size=-2>" + mbo.getString("WONUM") +
"</font></td>"
+ "<td width=10%><font size=-2>" + mbo.getString("SITEID") +
"</font></td>"
+ "<td width=10%><font size=-2>" + mbo.getString("STATUS") +
"</font></td>"
+ "</font></td>"
+ "</tr>"
+ "</table>")
val.append("<table border=0 width=500>" + "<col width=10%>" + "<col width=10%>"
+ "<col width=10%>"
+ "<thead>"
+ "<tr>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Location" + "</b>" + "</font>" + "</td>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Owner" + "</b>" + "</font>" + "</td>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Status Date" + "</b>" + "</font>" + "</td>"
+ "</thead>"
+ "</table>")
val.append("<table border=0 width=500>" + "<col width=10%>" + "<col width=10%>"
+ "<col width=10%>"
+ "<tr>"
+ "<td width=10%><font size=-2>" + mbo.getString("LOCATION") +
"</font></td>"
+ "<td width=10%><font size=-2>" + mbo.getString("OWNER") +
"</font></td>"
+ "<td width=10%><font size=-2>" + mbo.getString("STATUSDATE") +
"</font></td>"
+ "</font></td>"
+ "</tr>"
+ "</table>")
val.append("<hr>")
val.append("<font size=-2><b>DESCRIPTION</b></font><br>")
val.append(mbo.getString("DESCRIPTION") + "<br>")
val.append("<hr>")
##------------------------------------------------------------------------------
----
val.append("<font size=-2><b>RELATED RECORDS</b></font><br>")
# retrieve Related Records records and writes them in the buffer
relatedrecSet = mbo.getMboSet("RELATEDWO")
#related records header row
val.append("<table border=0 width=1000>" + "<col width=10%>" + "<col width=10%>"
+ "<col width=10%>" + "<col width=70%>"
+ "<thead>"
+ "<tr>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Class" + "</b>" + "</font>" + "</td>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Recordkey" + "</b>" + "</font>" + "</td>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Status" + "</b>" + "</font>" + "</td>"
+ "<td width=70%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Summary" + "</b>" + "</font>" + "</td>"
+ "</thead>"
+ "</table>")
currMbo=relatedrecSet.moveFirst()
while currMbo is not None:
val.append("<table border=0 width=1000>" + "<col width=10%>" +
"<col width=10%>" + "<col width=10%>" + "<col width=70%>"
+ "<tr>"
+ "<td width=10%><font size=-2>" +
relatedrecSet.getString("RELATEDRECWOCLASS") + "</font></td>"
+ "<td width=10%><font size=-2>" +
relatedrecSet.getString("RELATEDRECWONUM") + "</font></td>"
+ "<td width=10%><font size=-2>" +
relatedrecSet.getString("RELATEDRECWO.STATUS") + "</font></td>"
+ "<td width=70%><font size=-2>" +
relatedrecSet.getString("RELATEDRECWO.DESCRIPTION") + "</font></td>"
+ "</font></td>"
+ "</tr>"
+ "</table>")
currMbo=relatedrecSet.moveNext()
#retrieve work log records and writes them in the buffer
worklogSet = mbo.getMboSet("MODIFYWORKLOG")
worklogSet.setOrderBy("CREATEDATE")
val.append("<hr>")
val.append("<font size=-2><b>WORK LOG</b></font><br>")
# LOG records header row
#
# Changed the call from currmbo.getString for the longdescription to
HTML.toPlainText
# This is due to a problem with invalid HTML in the logs corrupting the
script and causing it to stop
#
val.append("<table border=0 width=1000>" + "<col width=10%>" + "<col width=10%>"
+ "<col width=10%>" + "<col width=70%>"
+ "<thead>"
+ "<tr>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Date Created" + "</b>" + "</font>" + "</td>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Created By" + "</b>" + "</font>" + "</td>"
+ "<td width=10%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Log Type" + "</b>" + "</font>" + "</td>"
+ "<td width=70%>" + "<font color=#000000 size=-2>"
+ "<b>" + "Summary" + "</b>" + "</font>" + "</td>"
+ "</thead>"
+ "</table>")
currMbo=worklogSet.moveFirst()
while currMbo is not None:
val.append("<table border=0 width=1000>" + "<col width=10%>" +
"<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<col width=70%>"
+ "<tr>"
+ "<td width=10%><font size=-2>" +
worklogSet.getString("CREATEDATE") + "</font></td>"
+ "<td width=10%><font size=-2>" + worklogSet.getString("CREATEBY")
+ "</font></td>"
+ "<td width=10%><font size=-2>" + worklogSet.getString("LOGTYPE")
+ "</font></td>"
+ "<td width=70%><font size=-2>" +
worklogSet.getString("DESCRIPTION") + "</font></td>"
+ "</font></td>"
+ "</tr>"
+ "<tr bgcolor=#C0C0C0>"
+ "<td COLSPAN=4 ><font size=-2>" +
HTML.toPlainText(currMbo.getString("DESCRIPTION_LONGDESCRIPTION")) +
"</font></td>"
+ "</tr>"
+ "</table>")
currMbo=worklogSet.moveNext()
# sets the formatted string in the attributes value
mbo.getMboValue("BPDSUMMARY").setValue(val.toString(),
MboConstants.NOACCESSCHECK | MboConstants.NOVALIDATION)

More Related Content

DOC
Form & frame
PDF
CSS3 Ready for Primetime
KEY
Html5 intro
RTF
مستند نص منسق جديد
PDF
Implementing Awesome: An HTML5/CSS3 Workshop
PDF
Tables and forms with HTML, CSS
PDF
Api vortrag
 
Form & frame
CSS3 Ready for Primetime
Html5 intro
مستند نص منسق جديد
Implementing Awesome: An HTML5/CSS3 Workshop
Tables and forms with HTML, CSS
Api vortrag
 

Similar to Automation Script for WO Summary in Maximo (20)

PPTX
PDF
A HTML5 platform demókon keresztül
TXT
Fcontratos
DOC
Rounded Shaped Box Example 1
PPTX
Table and Form HTML&CSS
PDF
Vaadin Components @ Angular U
TXT
Default bmimcv2e1993st 1bsp2400
PDF
HTML5 New and Improved
TXT
Md5 decrypter
PDF
Responsive Email Design and Development
DOC
shoubox script
PDF
Earn money with banner and text ads for Clickbank
PPTX
CSUN 2020: CSS Display Properties Versus HTML Semantics
DOCX
Borrador del blog
RTF
Earn money with banner and text ads for clickbank
PDF
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
DOC
incoming
TXT
A HTML5 platform demókon keresztül
Fcontratos
Rounded Shaped Box Example 1
Table and Form HTML&CSS
Vaadin Components @ Angular U
Default bmimcv2e1993st 1bsp2400
HTML5 New and Improved
Md5 decrypter
Responsive Email Design and Development
shoubox script
Earn money with banner and text ads for Clickbank
CSUN 2020: CSS Display Properties Versus HTML Semantics
Borrador del blog
Earn money with banner and text ads for clickbank
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
incoming
Ad

Recently uploaded (20)

PDF
Complications of Minimal Access-Surgery.pdf
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
Journal of Dental Science - UDMY (2021).pdf
PPTX
Module on health assessment of CHN. pptx
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PDF
International_Financial_Reporting_Standa.pdf
PPTX
Computer Architecture Input Output Memory.pptx
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PDF
Race Reva University – Shaping Future Leaders in Artificial Intelligence
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
PDF
English Textual Question & Ans (12th Class).pdf
PPTX
Virtual and Augmented Reality in Current Scenario
Complications of Minimal Access-Surgery.pdf
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
Journal of Dental Science - UDMY (2021).pdf
Module on health assessment of CHN. pptx
Introduction to pro and eukaryotes and differences.pptx
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
Hazard Identification & Risk Assessment .pdf
AI-driven educational solutions for real-life interventions in the Philippine...
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
International_Financial_Reporting_Standa.pdf
Computer Architecture Input Output Memory.pptx
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
Race Reva University – Shaping Future Leaders in Artificial Intelligence
Environmental Education MCQ BD2EE - Share Source.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
English Textual Question & Ans (12th Class).pdf
Virtual and Augmented Reality in Current Scenario
Ad

Automation Script for WO Summary in Maximo

  • 1. from java.lang import StringBuilder from psdi.mbo import MboConstants from psdi.util import HTML val = StringBuilder() # retrieve attributes and writes them in HTML format in the buffer #Work Order header row val.append("<table border=0 width=500>" + "<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<thead>" + "<tr>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "WO Number" + "</b>" + "</font>" + "</td>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "SITE" + "</b>" + "</font>" + "</td>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "STATUS" + "</b>" + "</font>" + "</td>" + "</thead>" + "</table>") val.append("<table border=0 width=500>" + "<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<tr>" + "<td width=10%><font size=-2>" + mbo.getString("WONUM") + "</font></td>" + "<td width=10%><font size=-2>" + mbo.getString("SITEID") + "</font></td>" + "<td width=10%><font size=-2>" + mbo.getString("STATUS") + "</font></td>" + "</font></td>" + "</tr>" + "</table>") val.append("<table border=0 width=500>" + "<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<thead>" + "<tr>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "Location" + "</b>" + "</font>" + "</td>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "Owner" + "</b>" + "</font>" + "</td>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "Status Date" + "</b>" + "</font>" + "</td>" + "</thead>" + "</table>") val.append("<table border=0 width=500>" + "<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<tr>" + "<td width=10%><font size=-2>" + mbo.getString("LOCATION") + "</font></td>" + "<td width=10%><font size=-2>" + mbo.getString("OWNER") + "</font></td>" + "<td width=10%><font size=-2>" + mbo.getString("STATUSDATE") + "</font></td>" + "</font></td>" + "</tr>" + "</table>") val.append("<hr>") val.append("<font size=-2><b>DESCRIPTION</b></font><br>")
  • 2. val.append(mbo.getString("DESCRIPTION") + "<br>") val.append("<hr>") ##------------------------------------------------------------------------------ ---- val.append("<font size=-2><b>RELATED RECORDS</b></font><br>") # retrieve Related Records records and writes them in the buffer relatedrecSet = mbo.getMboSet("RELATEDWO") #related records header row val.append("<table border=0 width=1000>" + "<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<col width=70%>" + "<thead>" + "<tr>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "Class" + "</b>" + "</font>" + "</td>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "Recordkey" + "</b>" + "</font>" + "</td>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "Status" + "</b>" + "</font>" + "</td>" + "<td width=70%>" + "<font color=#000000 size=-2>" + "<b>" + "Summary" + "</b>" + "</font>" + "</td>" + "</thead>" + "</table>") currMbo=relatedrecSet.moveFirst() while currMbo is not None: val.append("<table border=0 width=1000>" + "<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<col width=70%>" + "<tr>" + "<td width=10%><font size=-2>" + relatedrecSet.getString("RELATEDRECWOCLASS") + "</font></td>" + "<td width=10%><font size=-2>" + relatedrecSet.getString("RELATEDRECWONUM") + "</font></td>" + "<td width=10%><font size=-2>" + relatedrecSet.getString("RELATEDRECWO.STATUS") + "</font></td>" + "<td width=70%><font size=-2>" + relatedrecSet.getString("RELATEDRECWO.DESCRIPTION") + "</font></td>" + "</font></td>" + "</tr>" + "</table>") currMbo=relatedrecSet.moveNext() #retrieve work log records and writes them in the buffer worklogSet = mbo.getMboSet("MODIFYWORKLOG") worklogSet.setOrderBy("CREATEDATE") val.append("<hr>") val.append("<font size=-2><b>WORK LOG</b></font><br>") # LOG records header row # # Changed the call from currmbo.getString for the longdescription to HTML.toPlainText # This is due to a problem with invalid HTML in the logs corrupting the script and causing it to stop # val.append("<table border=0 width=1000>" + "<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<col width=70%>" + "<thead>" + "<tr>"
  • 3. + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "Date Created" + "</b>" + "</font>" + "</td>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "Created By" + "</b>" + "</font>" + "</td>" + "<td width=10%>" + "<font color=#000000 size=-2>" + "<b>" + "Log Type" + "</b>" + "</font>" + "</td>" + "<td width=70%>" + "<font color=#000000 size=-2>" + "<b>" + "Summary" + "</b>" + "</font>" + "</td>" + "</thead>" + "</table>") currMbo=worklogSet.moveFirst() while currMbo is not None: val.append("<table border=0 width=1000>" + "<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<col width=10%>" + "<col width=70%>" + "<tr>" + "<td width=10%><font size=-2>" + worklogSet.getString("CREATEDATE") + "</font></td>" + "<td width=10%><font size=-2>" + worklogSet.getString("CREATEBY") + "</font></td>" + "<td width=10%><font size=-2>" + worklogSet.getString("LOGTYPE") + "</font></td>" + "<td width=70%><font size=-2>" + worklogSet.getString("DESCRIPTION") + "</font></td>" + "</font></td>" + "</tr>" + "<tr bgcolor=#C0C0C0>" + "<td COLSPAN=4 ><font size=-2>" + HTML.toPlainText(currMbo.getString("DESCRIPTION_LONGDESCRIPTION")) + "</font></td>" + "</tr>" + "</table>") currMbo=worklogSet.moveNext() # sets the formatted string in the attributes value mbo.getMboValue("BPDSUMMARY").setValue(val.toString(), MboConstants.NOACCESSCHECK | MboConstants.NOVALIDATION)