Maximo Open Forum

 View Only
Expand all | Collapse all

Issue in the workflow validation

  • 1.  Issue in the workflow validation

    Posted 04-28-2021 13:09
    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 04-29-2021 09:34
    Can you post the code from your condition node?

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



  • 3.  RE: Issue in the workflow validation

    Posted 05-02-2021 02:43
    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

    Posted 05-02-2021 08:24
    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 05-04-2021 10:20
    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 05-05-2021 08:27
    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 05-03-2021 09:23
    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 05-03-2021 13:45
    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

    Posted 05-04-2021 20:24
    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.
    ------------------------------



  • 10.  RE: Issue in the workflow validation

    Posted 05-17-2022 16:19
    You can check out this developer from eastern europe. They've got nice reviews and a great portfolio. I'm sure they'll be able to help.

    ------------------------------
    Michael Smith
    Google
    ------------------------------



  • 11.  RE: Issue in the workflow validation

    Posted 05-17-2022 18:08
    Hi Mahadevan, is the goal to have a pass or fail? if so create a function that returns a pass or fail. like 0=(select compdates, date1,date2) 
    Somethin  like  the following (no guarantee it is correct)
    return Number
    is
    Rtn Number :=0
    begin
    if nvl(trunc(date1,'MI', sysdate,'MI') < trunc(date2,'MI') then
    return 1;
    else
    return 0;
    end if;

    HTH


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