Maximo List Archive

This is an archive of the Maximo Yahoo Community. The content of this pages may be a sometimes obsolete so please check post dates.
Thanks to the community owner Christopher Wanko for providing the content.



Maximo 7.5 Automated Scripting

From: shannon (2012-05-11 16:09)

Today I am on another mission.. Automated Scripting..
I am going to use the scripting to Populate scheduled start and finish dates on a workorder..etc..
Easy enough.. I go through the steps of creating a Script with Action Launch Point - There are 3 steps to complete before you can create.
1 step is simple just naming Launch Point, defining object and then naming the action (which is auto populated from the Launch point name given)
Step 2 - Is where i name my script and choose my variables.. This is where my issue starts. I don't have the New Row button to add any Variables.. From googleing...etc.. I can see that all the tutorials show that i should be able to add them here..
I can skip this step and create the varilables after the script is created, but then i am not able to define the variable..
Has anyone attempted this? and if so am i just missing a step?


From: Chris Lawless (2012-05-11 09:18)

Can you explain a little more about when you want the population to occur?
An action launch point is intended to be called from WorkFlow or an
Escalation, is that your intent or do you want it to execute during the
creation (Add), Update or Save? ....or when another attribute is changed?
Chris.
On Fri, May 11, 2012 at 9:09 AM, shannon <ssutton@emcor.net> wrote:
> **
>
>
> Today I am on another mission.. Automated Scripting..
>
> I am going to use the scripting to Populate scheduled start and finish
> dates on a workorder..etc..
>
> Easy enough.. I go through the steps of creating a Script with Action
> Launch Point - There are 3 steps to complete before you can create.
>
> 1 step is simple just naming Launch Point, defining object and then naming
> the action (which is auto populated from the Launch point name given)
>
> Step 2 - Is where i name my script and choose my variables.. This is where
> my issue starts. I don't have the New Row button to add any Variables..
> From googleing...etc.. I can see that all the tutorials show that i should
> be able to add them here..
>
> I can skip this step and create the varilables after the script is
> created, but then i am not able to define the variable..
>
> Has anyone attempted this? and if so am i just missing a step?
>
>
>


From: Chris Lawless (2012-05-11 09:19)

But yes... you can skip the variables if you choose to and use the setValue
method to populate the attributes...
Chris.
On Fri, May 11, 2012 at 9:09 AM, shannon <ssutton@emcor.net> wrote:
> **
>
>
> Today I am on another mission.. Automated Scripting..
>
> I am going to use the scripting to Populate scheduled start and finish
> dates on a workorder..etc..
>
> Easy enough.. I go through the steps of creating a Script with Action
> Launch Point - There are 3 steps to complete before you can create.
>
> 1 step is simple just naming Launch Point, defining object and then naming
> the action (which is auto populated from the Launch point name given)
>
> Step 2 - Is where i name my script and choose my variables.. This is where
> my issue starts. I don't have the New Row button to add any Variables..
> From googleing...etc.. I can see that all the tutorials show that i should
> be able to add them here..
>
> I can skip this step and create the varilables after the script is
> created, but then i am not able to define the variable..
>
> Has anyone attempted this? and if so am i just missing a step?
>
>
>


From: Shannon Sutton (2012-05-11 12:25)

Yes I am going to use an escalation to fire the script..
My script looks something like this




from java.util import Calendar
from java.util import Date

print 'WOSCHEDSTART - script execution started'

cal=Calendar.getInstance()
cal.setTime(targstartdate)
cal.add(Calendar.DATE, +1)
schedstart =  cal.getTime()
cal.add(Calendar.DATE,+30)
schedfinsh=cal.getTime()






print 'WOSCHEDSTART - script execution complete'


I am getting the error..
[5/11/12 6:32:38:768 MST] 00000048 SystemOut O 11 May 2012 06:32:38:768
[ERROR] [MXServer] [] Failed to execute action on escalation: {1037}
reference point: {309} for object {WORKORDER} with id {705816}
psdi.util.MXApplicationException: BMXAA7837E - An error occured that
prevented the UPDATESCHEDCOMPDATE script for the WOSCHEDCOMP launch point
from running.
NameError: name 'targstartdate' is not defined in <script> at line
number 11
Shannon Sutton
CMMS Specialist
EMCOR Government Services
Office: 571-403-8940
Cell: 571-970-7965
From: Chris Lawless <lawlessc@gmail.com>
To: MAXIMO@yahoogroups.com
Date: 05/11/2012 12:19 PM
Subject: Re: [MAXIMO List] Maximo 7.5 Automated Scripting
Sent by: MAXIMO@yahoogroups.com
But yes... you can skip the variables if you choose to and use the setValue
method to populate the attributes...
Chris.
On Fri, May 11, 2012 at 9:09 AM, shannon <ssutton@emcor.net> wrote:
> **
>
>
> Today I am on another mission.. Automated Scripting..
>
> I am going to use the scripting to Populate scheduled start and finish
> dates on a workorder..etc..
>
> Easy enough.. I go through the steps of creating a Script with Action
> Launch Point - There are 3 steps to complete before you can create.
>
> 1 step is simple just naming Launch Point, defining object and then
naming
> the action (which is auto populated from the Launch point name given)
>
> Step 2 - Is where i name my script and choose my variables.. This is
where
> my issue starts. I don't have the New Row button to add any Variables..
> From googleing...etc.. I can see that all the tutorials show that i
should
> be able to add them here..
>
> I can skip this step and create the varilables after the script is
> created, but then i am not able to define the variable..
>
> Has anyone attempted this? and if so am i just missing a step?
>
>
>
------------------------------------
Email addresses you might need:
Posting: MAXIMO@yahoogroups.com
Join : MAXIMO-subscribe@yahoogroups.com
Leave : MAXIMO-unsubscribe@yahoogroups.com
Cry : MAXIMO-owner@yahoogroups.com
Group : http://groups.yahoo.com/group/MAXIMOYahoo! Groups Links
This message is for the named person's use only. It may contain confidential,
proprietary or legally privileged information. No confidentiality or privilege
is waived or lost by any mistransmission. If you receive this message in error,
please immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender. You must not, directly or indirectly,
use, disclose, distribute, print, or copy any part of this message if you are
not the intended recipient.


From: Chris Lawless (2012-05-11 09:30)

To get the TARGSTARTDATE try something like this:
targstartdate = mbo.getString("TARGSTARTDATE")
although we may need to figure out the date equivalent or how to change the
string to a date.
Chris.
On Fri, May 11, 2012 at 9:25 AM, Shannon Sutton <ssutton@emcor.net> wrote:
> **
>
>
> Yes I am going to use an escalation to fire the script..
>
> My script looks something like this
>
>
>
>
> from java.util import Calendar
> from java.util import Date
>
> print 'WOSCHEDSTART - script execution started'
>
> cal=Calendar.getInstance()
> cal.setTime(targstartdate)
> cal.add(Calendar.DATE, +1)
> schedstart = cal.getTime()
> cal.add(Calendar.DATE,+30)
> schedfinsh=cal.getTime()
>
>
>
> print 'WOSCHEDSTART - script execution complete'
>
>
>
> I am getting the error..
>
> [5/11/12 6:32:38:768 MST] 00000048 SystemOut O 11 May 2012 06:32:38:768
> [ERROR] [MXServer] [] Failed to execute action on escalation: {1037}
> reference point: {309} for object {WORKORDER} with id {705816}
> psdi.util.MXApplicationException: BMXAA7837E - An error occured that
> prevented the UPDATESCHEDCOMPDATE script for the WOSCHEDCOMP launch point
> from running.
> NameError: name 'targstartdate' is not defined in <script> at line
> number 11
>
> Shannon Sutton
> CMMS Specialist
> EMCOR Government Services
> Office: 571-403-8940
> Cell: 571-970-7965
>
> From: Chris Lawless <lawlessc@gmail.com>
> To: MAXIMO@yahoogroups.com
> Date: 05/11/2012 12:19 PM
> Subject: Re: [MAXIMO List] Maximo 7.5 Automated Scripting
> Sent by: MAXIMO@yahoogroups.com
>
>
> But yes... you can skip the variables if you choose to and use the setValue
> method to populate the attributes...
>
> Chris.
>
> On Fri, May 11, 2012 at 9:09 AM, shannon <ssutton@emcor.net> wrote:
>
> > **
>
> >
> >
> > Today I am on another mission.. Automated Scripting..
> >
> > I am going to use the scripting to Populate scheduled start and finish
> > dates on a workorder..etc..
> >
> > Easy enough.. I go through the steps of creating a Script with Action
> > Launch Point - There are 3 steps to complete before you can create.
> >
> > 1 step is simple just naming Launch Point, defining object and then
> naming
> > the action (which is auto populated from the Launch point name given)
> >
> > Step 2 - Is where i name my script and choose my variables.. This is
> where
> > my issue starts. I don't have the New Row button to add any Variables..
> > From googleing...etc.. I can see that all the tutorials show that i
> should
> > be able to add them here..
> >
> > I can skip this step and create the varilables after the script is
> > created, but then i am not able to define the variable..
> >
> > Has anyone attempted this? and if so am i just missing a step?
> >
> >
> >
>
>
>
> ------------------------------------
>
>
> Email addresses you might need:
> Posting: MAXIMO@yahoogroups.com
> Join : MAXIMO-subscribe@yahoogroups.com
> Leave : MAXIMO-unsubscribe@yahoogroups.com
> Cry : MAXIMO-owner@yahoogroups.com
> Group : http://groups.yahoo.com/group/MAXIMOYahoo! Groups Links
>
> This message is for the named person's use only. It may contain
> confidential,
> proprietary or legally privileged information. No confidentiality or
> privilege
> is waived or lost by any mistransmission. If you receive this message in
> error,
> please immediately delete it and all copies of it from your system,
> destroy any
> hard copies of it and notify the sender. You must not, directly or
> indirectly,
> use, disclose, distribute, print, or copy any part of this message if you
> are
> not the intended recipient.
>
>
>
>


From: Shannon Sutton (2012-05-11 12:42)

I am guessing a datetime filed should be reportdate = mbo.getTimestamp
("REPORTDATE")
I am now getting an error weather is use timestamp or getString
Traceback (most recent call last):
File "<iostream>", line 9, in <module>
NameError: name 'mbo' is not defined
I have made the script a bit smaller until i can figure out what is going
on..
from java.util import Calendar
from java.util import Date
print 'WOTARCOMP - script execution started'
cal=Calendar.getInstance()
targstartdate = mbo.getTimestamp("TARGSTARTDATE")
targcompdate = mbo.getTimestamp("TARGCOMPDATE")
cal.setTime(targstartdate)
cal.add(Calendar.DATE,+30)
targcompdate=cal.getTime()
print 'WOTARCOMP - script execution complete'
Shannon Sutton
CMMS Specialist
EMCOR Government Services
Office: 571-403-8940
Cell: 571-970-7965
From: Chris Lawless <lawlessc@gmail.com>
To: MAXIMO@yahoogroups.com
Date: 05/11/2012 12:30 PM
Subject: Re: [MAXIMO List] Maximo 7.5 Automated Scripting
Sent by: MAXIMO@yahoogroups.com
To get the TARGSTARTDATE try something like this:
targstartdate = mbo.getString("TARGSTARTDATE")
although we may need to figure out the date equivalent or how to change the
string to a date.
Chris.
On Fri, May 11, 2012 at 9:25 AM, Shannon Sutton <ssutton@emcor.net> wrote:
> **
>
>
> Yes I am going to use an escalation to fire the script..
>
> My script looks something like this
>
>
>
>
> from java.util import Calendar
> from java.util import Date
>
> print 'WOSCHEDSTART - script execution started'
>
> cal=Calendar.getInstance()
> cal.setTime(targstartdate)
> cal.add(Calendar.DATE, +1)
> schedstart = cal.getTime()
> cal.add(Calendar.DATE,+30)
> schedfinsh=cal.getTime()
>
>
>
> print 'WOSCHEDSTART - script execution complete'
>
>
>
> I am getting the error..
>
> [5/11/12 6:32:38:768 MST] 00000048 SystemOut O 11 May 2012 06:32:38:768
> [ERROR] [MXServer] [] Failed to execute action on escalation: {1037}
> reference point: {309} for object {WORKORDER} with id {705816}
> psdi.util.MXApplicationException: BMXAA7837E - An error occured that
> prevented the UPDATESCHEDCOMPDATE script for the WOSCHEDCOMP launch point
> from running.
> NameError: name 'targstartdate' is not defined in <script> at line
> number 11
>
> Shannon Sutton
> CMMS Specialist
> EMCOR Government Services
> Office: 571-403-8940
> Cell: 571-970-7965
>
> From: Chris Lawless <lawlessc@gmail.com>
> To: MAXIMO@yahoogroups.com
> Date: 05/11/2012 12:19 PM
> Subject: Re: [MAXIMO List] Maximo 7.5 Automated Scripting
> Sent by: MAXIMO@yahoogroups.com
>
>
> But yes... you can skip the variables if you choose to and use the
setValue
> method to populate the attributes...
>
> Chris.
>
> On Fri, May 11, 2012 at 9:09 AM, shannon <ssutton@emcor.net> wrote:
>
> > **
>
> >
> >
> > Today I am on another mission.. Automated Scripting..
> >
> > I am going to use the scripting to Populate scheduled start and finish
> > dates on a workorder..etc..
> >
> > Easy enough.. I go through the steps of creating a Script with Action
> > Launch Point - There are 3 steps to complete before you can create.
> >
> > 1 step is simple just naming Launch Point, defining object and then
> naming
> > the action (which is auto populated from the Launch point name given)
> >
> > Step 2 - Is where i name my script and choose my variables.. This is
> where
> > my issue starts. I don't have the New Row button to add any Variables..
> > From googleing...etc.. I can see that all the tutorials show that i
> should
> > be able to add them here..
> >
> > I can skip this step and create the varilables after the script is
> > created, but then i am not able to define the variable..
> >
> > Has anyone attempted this? and if so am i just missing a step?
> >
> >
> >
>
>
>
> ------------------------------------
>
>
> Email addresses you might need:
> Posting: MAXIMO@yahoogroups.com
> Join : MAXIMO-subscribe@yahoogroups.com
> Leave : MAXIMO-unsubscribe@yahoogroups.com
> Cry : MAXIMO-owner@yahoogroups.com
> Group : http://groups.yahoo.com/group/MAXIMOYahoo! Groups Links
>
> This message is for the named person's use only. It may contain
> confidential,
> proprietary or legally privileged information. No confidentiality or
> privilege
> is waived or lost by any mistransmission. If you receive this message in
> error,
> please immediately delete it and all copies of it from your system,
> destroy any
> hard copies of it and notify the sender. You must not, directly or
> indirectly,
> use, disclose, distribute, print, or copy any part of this message if you
> are
> not the intended recipient.
>
>
>
>
------------------------------------
Email addresses you might need:
Posting: MAXIMO@yahoogroups.com
Join : MAXIMO-subscribe@yahoogroups.com
Leave : MAXIMO-unsubscribe@yahoogroups.com
Cry : MAXIMO-owner@yahoogroups.com
Group : http://groups.yahoo.com/group/MAXIMOYahoo! Groups Links
This message is for the named person's use only. It may contain confidential,
proprietary or legally privileged information. No confidentiality or privilege
is waived or lost by any mistransmission. If you receive this message in error,
please immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender. You must not, directly or indirectly,
use, disclose, distribute, print, or copy any part of this message if you are
not the intended recipient.


From: Chris Lawless (2012-05-11 09:53)

Try this... or a variation... this will set the Target Finish to the value
of Target Start plus one day:
from psdi.mbo import MboRemote
from psdi.mbo import MboConstants
from psdi.mbo import MboSetRemote
from java.util import Calendar
from java.util import Date
targstart = mbo.getDate("TARGSTARTDATE")
cal=Calendar.getInstance()
cal.setTime(targstart )
cal.add(Calendar.DATE, +1)
targstart = cal.getTime()
targfin = targstart
mbo.setValue("TARGCOMPDATE",targfin)
Chris.
On Fri, May 11, 2012 at 9:42 AM, Shannon Sutton <ssutton@emcor.net> wrote:
> **
>
>
> I am guessing a datetime filed should be reportdate = mbo.getTimestamp
> ("REPORTDATE")
>
> I am now getting an error weather is use timestamp or getString
>
> Traceback (most recent call last):
> File "<iostream>", line 9, in <module>
> NameError: name 'mbo' is not defined
>
> I have made the script a bit smaller until i can figure out what is going
> on..
>
>
> from java.util import Calendar
>
> from java.util import Date
>
> print 'WOTARCOMP - script execution started'
> cal=Calendar.getInstance()
> targstartdate = mbo.getTimestamp("TARGSTARTDATE")
> targcompdate = mbo.getTimestamp("TARGCOMPDATE")
> cal.setTime(targstartdate)
> cal.add(Calendar.DATE,+30)
> targcompdate=cal.getTime()
> print 'WOTARCOMP - script execution complete'
>
>
> Shannon Sutton
> CMMS Specialist
> EMCOR Government Services
> Office: 571-403-8940
> Cell: 571-970-7965
>
> From: Chris Lawless <lawlessc@gmail.com>
> To: MAXIMO@yahoogroups.com
> Date: 05/11/2012 12:30 PM
>
> Subject: Re: [MAXIMO List] Maximo 7.5 Automated Scripting
> Sent by: MAXIMO@yahoogroups.com
>
> To get the TARGSTARTDATE try something like this:
>
> targstartdate = mbo.getString("TARGSTARTDATE")
>
> although we may need to figure out the date equivalent or how to change the
> string to a date.
>
> Chris.
>
> On Fri, May 11, 2012 at 9:25 AM, Shannon Sutton <ssutton@emcor.net> wrote:
>
> > **
>
> >
> >
> > Yes I am going to use an escalation to fire the script..
> >
> > My script looks something like this
> >
> >
> >
> >
> > from java.util import Calendar
> > from java.util import Date
> >
> > print 'WOSCHEDSTART - script execution started'
> >
> > cal=Calendar.getInstance()
> > cal.setTime(targstartdate)
> > cal.add(Calendar.DATE, +1)
> > schedstart = cal.getTime()
> > cal.add(Calendar.DATE,+30)
> > schedfinsh=cal.getTime()
> >
> >
> >
> > print 'WOSCHEDSTART - script execution complete'
> >
> >
> >
> > I am getting the error..
> >
> > [5/11/12 6:32:38:768 MST] 00000048 SystemOut O 11 May 2012 06:32:38:768
> > [ERROR] [MXServer] [] Failed to execute action on escalation: {1037}
> > reference point: {309} for object {WORKORDER} with id {705816}
> > psdi.util.MXApplicationException: BMXAA7837E - An error occured that
> > prevented the UPDATESCHEDCOMPDATE script for the WOSCHEDCOMP launch point
> > from running.
> > NameError: name 'targstartdate' is not defined in <script> at line
> > number 11
> >
> > Shannon Sutton
> > CMMS Specialist
> > EMCOR Government Services
> > Office: 571-403-8940
> > Cell: 571-970-7965
> >
> > From: Chris Lawless <lawlessc@gmail.com>
> > To: MAXIMO@yahoogroups.com
> > Date: 05/11/2012 12:19 PM
> > Subject: Re: [MAXIMO List] Maximo 7.5 Automated Scripting
> > Sent by: MAXIMO@yahoogroups.com
> >
> >
> > But yes... you can skip the variables if you choose to and use the
> setValue
> > method to populate the attributes...
> >
> > Chris.
> >
> > On Fri, May 11, 2012 at 9:09 AM, shannon <ssutton@emcor.net> wrote:
> >
> > > **
> >
> > >
> > >
> > > Today I am on another mission.. Automated Scripting..
> > >
> > > I am going to use the scripting to Populate scheduled start and finish
> > > dates on a workorder..etc..
> > >
> > > Easy enough.. I go through the steps of creating a Script with Action
> > > Launch Point - There are 3 steps to complete before you can create.
> > >
> > > 1 step is simple just naming Launch Point, defining object and then
> > naming
> > > the action (which is auto populated from the Launch point name given)
> > >
> > > Step 2 - Is where i name my script and choose my variables.. This is
> > where
> > > my issue starts. I don't have the New Row button to add any Variables..
> > > From googleing...etc.. I can see that all the tutorials show that i
> > should
> > > be able to add them here..
> > >
> > > I can skip this step and create the varilables after the script is
> > > created, but then i am not able to define the variable..
> > >
> > > Has anyone attempted this? and if so am i just missing a step?
> > >
> > >
> > >
> >
> >
> >
> > ------------------------------------
> >
> >
> > Email addresses you might need:
> > Posting: MAXIMO@yahoogroups.com
> > Join : MAXIMO-subscribe@yahoogroups.com
> > Leave : MAXIMO-unsubscribe@yahoogroups.com
> > Cry : MAXIMO-owner@yahoogroups.com
> > Group : http://groups.yahoo.com/group/MAXIMOYahoo! Groups Links
> >
> > This message is for the named person's use only. It may contain
> > confidential,
> > proprietary or legally privileged information. No confidentiality or
> > privilege
> > is waived or lost by any mistransmission. If you receive this message in
> > error,
> > please immediately delete it and all copies of it from your system,
> > destroy any
> > hard copies of it and notify the sender. You must not, directly or
> > indirectly,
> > use, disclose, distribute, print, or copy any part of this message if you
> > are
> > not the intended recipient.
> >
> >
> >
> >
>
>
>
> ------------------------------------
>
> Email addresses you might need:
> Posting: MAXIMO@yahoogroups.com
> Join : MAXIMO-subscribe@yahoogroups.com
> Leave : MAXIMO-unsubscribe@yahoogroups.com
> Cry : MAXIMO-owner@yahoogroups.com
> Group : http://groups.yahoo.com/group/MAXIMOYahoo! Groups Links
>
> This message is for the named person's use only. It may contain
> confidential,
> proprietary or legally privileged information. No confidentiality or
> privilege
> is waived or lost by any mistransmission. If you receive this message in
> error,
> please immediately delete it and all copies of it from your system,
> destroy any
> hard copies of it and notify the sender. You must not, directly or
> indirectly,
> use, disclose, distribute, print, or copy any part of this message if you
> are
> not the intended recipient.
>
>
>


From: daxu cao (2012-05-11 11:27)

Shannon,
That is what we have experinced beofore, there is a workaround, created your scirpt and launch point, and open the lauch point again, you shall be able to add variable.
 
 
Daxu Cao
Portland General Electric
 
From: shannon <ssutton@emcor.net>
To: MAXIMO@yahoogroups.com
Sent: Friday, May 11, 2012 9:09 AM
Subject: [MAXIMO List] Maximo 7.5 Automated Scripting
 
Today I am on another mission.. Automated Scripting..
I am going to use the scripting to Populate scheduled start and finish dates on a workorder..etc..
Easy enough.. I go through the steps of creating a Script with Action Launch Point - There are 3 steps to complete before you can create.
1 step is simple just naming Launch Point, defining object and then naming the action (which is auto populated from the Launch point name given)
Step 2 - Is where i name my script and choose my variables.. This is where my issue starts. I don't have the New Row button to add any Variables.. From googleing...etc.. I can see that all the tutorials show that i should be able to add them here..
I can skip this step and create the varilables after the script is created, but then i am not able to define the variable..
Has anyone attempted this? and if so am i just missing a step?