SlideShare una empresa de Scribd logo
1 de 3
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)

Más contenido relacionado

Similar a Automation Script for WO Summary in Maximo

HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference ZürichHTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
Robert Nyman
 

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

HTML5
HTML5HTML5
HTML5
 
A HTML5 platform demókon keresztül
A HTML5 platform demókon keresztülA HTML5 platform demókon keresztül
A HTML5 platform demókon keresztül
 
Fcontratos
FcontratosFcontratos
Fcontratos
 
Rounded Shaped Box Example 1
Rounded Shaped Box Example 1Rounded Shaped Box Example 1
Rounded Shaped Box Example 1
 
Table and Form HTML&CSS
Table and Form HTML&CSSTable and Form HTML&CSS
Table and Form HTML&CSS
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
 
Default bmimcv2e1993st 1bsp2400
Default bmimcv2e1993st 1bsp2400Default bmimcv2e1993st 1bsp2400
Default bmimcv2e1993st 1bsp2400
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and Improved
 
Md5 decrypter
Md5 decrypterMd5 decrypter
Md5 decrypter
 
Responsive Email Design and Development
Responsive Email Design and DevelopmentResponsive Email Design and Development
Responsive Email Design and Development
 
Html and css
Html and cssHtml and css
Html and css
 
1cst
1cst1cst
1cst
 
shoubox script
shoubox scriptshoubox script
shoubox script
 
Earn money with banner and text ads for Clickbank
Earn money with banner and text ads for ClickbankEarn money with banner and text ads for Clickbank
Earn money with banner and text ads for Clickbank
 
CSUN 2020: CSS Display Properties Versus HTML Semantics
CSUN 2020: CSS Display Properties Versus HTML SemanticsCSUN 2020: CSS Display Properties Versus HTML Semantics
CSUN 2020: CSS Display Properties Versus HTML Semantics
 
Borrador del blog
Borrador del blogBorrador del blog
Borrador del blog
 
Earn money with banner and text ads for clickbank
Earn money with banner and text ads for clickbankEarn money with banner and text ads for clickbank
Earn money with banner and text ads for clickbank
 
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference ZürichHTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference Zürich
 
incoming
incomingincoming
incoming
 
Theme
ThemeTheme
Theme
 

Último

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Último (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

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)