Maximo: Mimic Workflow assignments with an SQL query

依然范特西╮ 提交于 2019-12-08 11:48:42

问题


I want to write an SQL query that mimics the results in the Maximo Start Center assignments section. The assignments are workflow assignments.

I tried querying the workorder table and specifying the assignedownergroup that the user is in:

select
    *
from
    workorder
where
    status in ('WAPPR','APPR','INPRG')
    and assignedownergroup = 'FIRE'

However, the query returns more work orders than what's shown in the Start Center assignments.

How can I write a query to mimic the workflow assignments in the Start Center?


回答1:


My other answer would work if the portlet you highlighted was a Result Set against WORKORDER, but it is not. The portlet you have highlighted is the Workflow Inbox, which is based on WFASSIGNMENT where assigncode = 'userid'.

A full query that mimics the workflow inbox would look like this, in Oracle SQL:

select
    (select 'WO '||wonum||' ('||description||') is waiting for '||wfassignment.description 
        from workorder 
        where workorderid = wfassignment.ownerid
            and wfassignment.ownertable = 'WORKORDER'
        /* Union in other tables */) description,
    app
from wfassignment
where assignstatus = 'ACTIVE'
    and assigncode = 'JDOE'

I'm not sure where the WO prefix on the assignment description comes from. But since you could add workflow to your own app based on your own object, I would like to think it comes from metadata somewhere instead of code. And the description itself is probably a format string in MAXMESSAGES.

You'll notice the Union in comment in my query, where you would add unioned queries against PR or PM or ASSET or whatever.




回答2:


The easiest way to get the SQL Maximo is running is:

  1. Go to the Logging application
  2. Select the sql Root Logger and add a "child" Logger of WORKORDER.WORKORDER (that's SERVICE.OBJECT from DB Config) with a Log Level of INFO.
  3. Get ready to open your log file.
  4. Load your start center.
  5. Open your log file.

The SQL issued by Maximo to load the result set should be near the bottom of your log file.



来源:https://stackoverflow.com/questions/57938379/maximo-mimic-workflow-assignments-with-an-sql-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!