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.



Apply a ROUTE to workorder through Automation Scripting

From: mjhanscom (2016-08-18 06:31)


I am trying to apply a ROUTE to a work order through automation scripting upon the selection of particular SUPERVISOR. I have been able to populate the ROUTE ID to the workorder, I've seen this in the database, but I am obviously not importing the proper class to apply the ROUTE to the workorder as the children work orders are not being created. The script is not producing any error messages either.
Here is what I have thus far any insight or suggestions are welcome and thank you in advance.
Maximo 7.5.0.9
SQL Server 2008
WebSphere

from psdi.util import MXApplicationException
from psdi.mbo import MboConstants
from psdi.mbo import SqlFormat
from psdi.server import MXServer

from psdi.app.workorder import WOSet
from psdi.app.workorder import WO

def getMboSet(objectName):
return MXServer.getMXServer().getMboSet(objectName, mbo.getUserInfo())

woSet = getMboSet("WORKORDER")
if type == 'PROJ' and super == 'SUPERNAME':
route = 'ROUTETEST'
else:
route = ' '


Thanks again,
Mike


From: Adam Davis (2016-08-18 08:48)

Mike,
Route's one of those fields you can't populate directly. You've got to
call a workorder function to apply it. Try replacing this line:
route = 'ROUTETEST'
with this:
mbo.applyRoute('ROUTETEST', None)
Thanks,
Adam Davis
Asset Partners
On Thu, Aug 18, 2016 at 8:31 AM, mjhanscom@comcast.net [MAXIMO] <
MAXIMO@yahoogroups.com> wrote:
>
>
>
> I am trying to apply a ROUTE to a work order through automation scripting
> upon the selection of particular SUPERVISOR. I have been able to populate
> the ROUTE ID to the workorder, I've seen this in the database, but I am
> obviously not importing the proper class to apply the ROUTE to the
> workorder as the children work orders are not being created. The script is
> not producing any error messages either.
> Here is what I have thus far any insight or suggestions are welcome and
> thank you in advance.
> Maximo 7.5.0.9
> SQL Server 2008
> WebSphere
>
>
> from psdi.util import MXApplicationException
> from psdi.mbo import MboConstants
> from psdi.mbo import SqlFormat
> from psdi.server import MXServer
>
> from psdi.app.workorder import WOSet
> from psdi.app.workorder import WO
>
>
> def getMboSet(objectName):
> return MXServer.getMXServer().getMboSet(objectName, mbo.getUserInfo())
>
> woSet = getMboSet("WORKORDER")
> if type == 'PROJ' and super == 'SUPERNAME':
> route = 'ROUTETEST'
> else:
> route = ' '
>
>
>
>
> Thanks again,
> Mike
>
>
>
>
>


From: maximal (2016-08-18 06:56)

Okay, you got the workorders, but I don't see where you are getting the children for each workorder.
-C

---In MAXIMO@yahoogroups.com, <mjhanscom@comcast.net> wrote :
I am trying to apply a ROUTE to a work order through automation scripting upon the selection of particular SUPERVISOR. I have been able to populate the ROUTE ID to the workorder, I've seen this in the database, but I am obviously not importing the proper class to apply the ROUTE to the workorder as the children work orders are not being created. The script is not producing any error messages either.
Here is what I have thus far any insight or suggestions are welcome and thank you in advance.
Maximo 7.5.0.9
SQL Server 2008
WebSphere


from psdi.util import MXApplicationException
from psdi.mbo import MboConstants
from psdi.mbo import SqlFormat
from psdi.server import MXServer

from psdi.app.workorder import WOSet
from psdi.app.workorder import WO


def getMboSet(objectName):
return MXServer.getMXServer().getMboSet(objectName, mbo.getUserInfo())

woSet = getMboSet("WORKORDER")
if type == 'PROJ' and super == 'SUPERNAME':
route = 'ROUTETEST'
else:
route = ' '




Thanks again,
Mike




From: mjhanscom (2016-08-22 08:06)

Thanks Adam, I tried your suggestion with the same result, the ROUTE field gets populated on the WORKORDER table, but the children work orders are not created. Still searching for solution.
Mike


From: swkim (2016-08-23 11:45)

Is the route you're trying to apply set to create child work orders, tasks, or multi asset locci?


From: mjhanscom (2016-08-24 03:44)

The route is set to create child work orders.
Mike