Maximo 7.6 - Conditionally approving labor transactions with automation script and escalation

1k views Asked by At

Thanks in advance.

We have a Maximo automation script (python) that approves all labor transactions when it runs from a scheduled escalation. "mbo.approveLaborTransaction()" is the entire script. No problems with the automation script or the escalation.

But, instead of approving ALL labor, when it runs, we would like to only approve labor where the start date is over 21 days ago. (This will give employees time to edit their labor records. Approved labor can't be edited.)

Is this conditional approval of labor records possible through the python script? And if so, how?

If not, is it possible to put conditions on the escalation that calls the automation script? Currently, there is a condition, 'GENAPPRSERVRECEIPT=0', on the escalation. (which means where labor NOT approved) I tried adding '...AND (STARTDATETIME < (SYSDATE - 21))', but that did not work.

I'm open to other methods as well. Thanks. Ryan

1

There are 1 answers

0
RyanE On

Applying the conditional approval of labor records (all labor started over 21 days ago) can be done in the escalation. I'm not saying it can't be done in the automation script. But, it is easy enough to write the SQL filter in the "Condition" box, I found out. I had started down this path first, but had used the wrong database field in my expression.

Note, while using the "Condition" writer tool, Maximo shows a drop down of fields to choose from to apply to the filter. Don't use these. Go to the database itself and find the correct field you need to use. In this case, 'StartDate' instead of 'StartDateTime'.

Here is my updated expression used in the escalation: GENAPPRSERVRECEIPT=0 and ( STARTDATE < (TRUNC(SYSDATE) - 21))