Maximo Open Forum

Expand all | Collapse all

Issue in the workflow validation

  • 1.  Issue in the workflow validation

    Posted 18 days ago
    Dear All,

    There was a requirement to compare two dates on the Service Request application upto the minutes level and I used the oracle trunc function for the same.The system is not allowing to proceed with the database error 932 related to invalid query but the same query when executed in the database works well.

    This comparison upto the minutes level is needed as we are stopping the system from proceeding if the reported date is less than the problem date.Is there any suggestions as to how the same has been achieved and if the logic has to be done outside the workflow if the same is not feasible to achieve in the workflow designer.

    Regards,
    Mahadevan
    #MaximoUserGroups

    ------------------------------
    Mahadevan Ramakrishnan
    ------------------------------


  • 2.  RE: Issue in the workflow validation

    Posted 17 days ago
    Can you post the code from your condition node?

    ------------------------------
    Travis Herron
    Pensacola Christian College
    ------------------------------



  • 3.  RE: Issue in the workflow validation

    Posted 14 days ago
    Dear Travis,

    Please find below the logic used in the condition node

    :AFFECTEDDATE is not null and trunc(:AFFECTEDDATE,'MI') < trunc(:REPORTDATE,'MI')

    ------------------------------
    Mahadevan Ramakrishnan
    Tata Consultancy Services
    ------------------------------



  • 4.  RE: Issue in the workflow validation

    Solution Provider
    Posted 14 days ago
    Hi Mahadevan - At Maven, we have identified a number of issues related to bind variables (usually in Conditions and Table Domains, mostly) not functioning properly.  We have found that Maximo translates the value to an empty string, instead of null.  Looking at your usage, is it possible that either the Affected Date or the Reported Date are blank?  If they were blank, then this type of error might make sense if you are trying to truncate the Affected Date to the Minute, but the date is being interpreted as a String.

    Just a suggestion.

    Aaron
    Maven Asset Management






  • 5.  RE: Issue in the workflow validation

    Posted 12 days ago
    Hello,


    (:AFFECTEDDATE - :REPORTDATE) *24 *60 will give you minutes between 2 dates. You can put the logic in the condition node to act based upon the minutes in this expression.

    ------------------------------
    Pankaj Bhide
    Berkeley National Laboratory
    ------------------------------



  • 6.  RE: Issue in the workflow validation

    Posted 11 days ago
    Have you considered using an oracle function that returns a 1 or a 0?

    The node 0=(select "function name"(:AFFECTEDDATE,:REPORTDATE) from DUAL))

    Let the Oracle function do the comparison.
    We have some pretty complex SQL that returns a 1 or a 0 in our workflows

    ------------------------------
    Wes Williams
    Northrop Grumman
    ------------------------------



  • 7.  RE: Issue in the workflow validation

    Posted 13 days ago
    When you tried it within Maximo, did it ALWAYS fail/throw an error, or was it just sometimes? 

    If sometimes, I would look for any patterns within the records where it failed.

    If always:  TRUNC is an Oracle-exclusive command, I believe.  I have had occasions where Maximo mis-handled commands that weren't ANSI compliant.  We use SQL Server so I can't test to see if what you are encountering is because of this, but it's a decent guess that Maximo just can't interpret the TRUNC command.

    ------------------------------
    Travis Herron
    Pensacola Christian College
    ------------------------------



  • 8.  RE: Issue in the workflow validation

    Posted 13 days ago
    Yes,it didnt get through in the workflow validation stage and the workflow process revision failed to get validated.As the need was pressing,my colleague had performed the back end update and tested the entire flow in UAT which worked as he had mentioned.

    Is there any alternative to trunc function we can use in the workflow condition node or we have to handle the comparison separately through an automation script or a java code.

    Regards,
    Mahadevan

    ------------------------------
    Mahadevan Ramakrishnan
    Tata Consultancy Services
    ------------------------------



  • 9.  RE: Issue in the workflow validation

    Maximo Certified
    Posted 12 days ago
    Before Maximo allows you to save a condition (similar for data restrictions) it evaluates the condition against the database with a zombie MBO (think advanced search where all values are null) and will fail in these scenarios since Oracle won't let you truncate a string or null value like that. We requested IBM loosen these to a warning so you can proceed even if it fails validation and they agreed to change it in 7.6.1.3 (APAR IJ27258) in our scenario at least. It's helpful to know it doesn't successfully evaluate but there are situations where you know it would in the actual application (such as something depending on needing an owner) and want to still allow it.

    On data restrictions, what we had to do was set the condition to be 1=1, associate the condition to the data restriction, and then adjust the condition after which would then allow it. With workflow it's trickier since you're not referencing a condition. You could utilize a custom condition automation script as you mentioned, though I would have a check in your script like:
    if mbo.isZombie(): 
        evalresult=True
    else:
        # NORMAL LOGIC here

    We had to do that to avoid errors when we try to retrieve sets and such in our normal logic that aren't allowed on a zombie record.

    ------------------------------
    Steven Shull
    Projetech Inc.
    ------------------------------