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.



How can I query Automation Script Launch Point Event Conditions, Event Type, and Save settings?

From: boyddensmore (2018-03-09 17:08)

Hello everyone!

I'm developing queries to help identify inconsistencies between our many Maximo instances and I'd like to be able to query all details from our automation script launch points, such as (but not limited to) conditions, event types, and save settings. The problem is, these are non-persistent fields and I'm not sure where to get the information from, or if I even can. We have Object, Attribute, Action, and Integration scripts and I'd like similar details for the action and integration scripts.

We're running Maximo 7.6.0.5 using Oracle 12.1 for the database.

Thanks in advance for any guidance!


From: Chris Lawless (2018-03-12 11:08)

You need to look at LAUNCHPOINT.OBJECTEVENT, it is a bit encoded value that
decodes to identify the active launch points, the script below was for 7.5
but I'd assume something very similar in 7.6.0.x even with the additional
events. The values decodes to a binary string where each bit represents it
being active (or not).
SELECT lp.autoscript,lp.launchpointtype,lp.objectname,
lp.active as LPActive,
bitand(lp.objectevent,8)/8 as OnDelete,
bitand(lp.objectevent,4)/4 as OnUpdate,
bitand(lp.objectevent,2)/2 as OnAdd,
bitand(lp.objectevent,1)/1 as "OnInit",
s.source
FROM SCRIPTLAUNCHPOINT LP,AUTOSCRIPT S
where lp.autoscript = s.autoscript
and bitand(lp.objectevent,1)/1 = 1;
On Fri, Mar 9, 2018 at 12:08 PM, boyddensmore@protonmail.com [MAXIMO] <
MAXIMO@yahoogroups.com> wrote:
>
>
> Hello everyone!
>
>
> I'm developing queries to help identify inconsistencies between our many
> Maximo instances and I'd like to be able to query all details from our
> automation script launch points, such as (but not limited to) conditions,
> event types, and save settings. The problem is, these are non-persistent
> fields and I'm not sure where to get the information from, or if I even
> can. We have Object, Attribute, Action, and Integration scripts and I'd
> like similar details for the action and integration scripts.
>
>
> We're running Maximo 7.6.0.5 using Oracle 12.1 for the database.
>
>
> Thanks in advance for any guidance!
>
>
>
>
>


From: boyddensmore (2018-03-16 19:44)

Fantastic, thank you so much for the tip! Based on that I've developed two Oracle SQL scripts to show details for Object and Attribute launch points.
I'm compiling all of my details using Python, so I'll just create another SQL script for the remaining details.
/*******************************************************************************
* Launch points, bitwise comparison
* Object Launch Point
*******************************************************************************/
SELECT scriptlaunchpoint.autoscript,
scriptlaunchpoint.launchpointtype,
scriptlaunchpoint.launchpointname,
scriptlaunchpoint.objectname,
scriptlaunchpoint.active,
scriptlaunchpoint.objectevent,
TRIM(CASE WHEN scriptlaunchpoint.objectevent BETWEEN 2 AND 1023 THEN ' onSave' ELSE NULL END ||
decode(bitand(scriptlaunchpoint.objectevent,1), 1, ' Initialize', NULL)||
decode(bitand(scriptlaunchpoint.objectevent,1024), 1024, ' App Validate', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,2048), 2048, ' Can Add', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,4096), 4096, ' Can Delete', NULL)) AS "EVENT",

TRIM(decode(bitand(scriptlaunchpoint.objectevent,2), 2, ' Add', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,4), 4, ' Update', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,8), 8, ' Delete', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,16), 16, ' Add', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,32), 32, ' Update', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,64), 64, ' Delete', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,128), 128, ' Add', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,256), 256, ' Update', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,512), 512, ' Delete', NULL)) AS "SAVE",

TRIM(CASE WHEN (bitand(scriptlaunchpoint.objectevent,2) +
bitand(scriptlaunchpoint.objectevent,4) +
bitand(scriptlaunchpoint.objectevent,8) > 0) THEN ' Before Save' ELSE NULL END ||
CASE WHEN (bitand(scriptlaunchpoint.objectevent,16) +
bitand(scriptlaunchpoint.objectevent,32) +
bitand(scriptlaunchpoint.objectevent,64) > 0) THEN ' After Save' ELSE NULL END ||
CASE WHEN (bitand(scriptlaunchpoint.objectevent,128) +
bitand(scriptlaunchpoint.objectevent,256) +
bitand(scriptlaunchpoint.objectevent,512) > 0) THEN ' After Commit' ELSE NULL END) AS "TIMING"
FROM scriptlaunchpoint
WHERE scriptlaunchpoint.launchpointtype = 'OBJECT'
ORDER BY autoscript, launchpointtype, objectname
;
/*******************************************************************************
* Launch points, bitwise comparison
* Attribute Launch Point
*******************************************************************************/
SELECT scriptlaunchpoint.autoscript,
scriptlaunchpoint.launchpointtype,
scriptlaunchpoint.launchpointname,
scriptlaunchpoint.objectname,
scriptlaunchpoint.active,
scriptlaunchpoint.objectevent,
TRIM(CASE WHEN scriptlaunchpoint.objectevent = 0 THEN ' Validate ' ELSE NULL END ||
decode(bitand(scriptlaunchpoint.objectevent,1), 1, ' Run action', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,2), 2, ' Initialize Value', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,8), 8, ' Initialize Access Restriction', NULL) ||
decode(bitand(scriptlaunchpoint.objectevent,64), 64, ' Retrieve list', NULL)) "EVENT"
FROM scriptlaunchpoint
WHERE scriptlaunchpoint.launchpointtype = 'ATTRIBUTE'
ORDER BY autoscript, launchpointtype, objectname
;


From: daveb_thomas (2018-03-26 10:16)

The SQL for DB2, if you return a NULL the whole value becomes a NULL

-- Get Attribute Event
select scriptlaunchpoint.autoscript,
scriptlaunchpoint.launchpointtype,
scriptlaunchpoint.launchpointname,
scriptlaunchpoint.objectname,
scriptlaunchpoint.active,
scriptlaunchpoint.objectevent,
trim(case when scriptlaunchpoint.objectevent = 0 then ' Validate ' else '' end ||
decode(bitand(scriptlaunchpoint.objectevent,1), 1, ' Run action', '') ||
decode(bitand(scriptlaunchpoint.objectevent,2), 2, ' Initialize Value', '') ||
decode(bitand(scriptlaunchpoint.objectevent,8), 8, ' Initialize Access Restriction', '') ||
decode(bitand(scriptlaunchpoint.objectevent,64), 64, ' Retrieve list', '')) "EVENT"
from scriptlaunchpoint
where scriptlaunchpoint.launchpointtype = 'ATTRIBUTE'
order by autoscript, launchpointtype, objectname
;
-- Get Object Event
select scriptlaunchpoint.autoscript,
scriptlaunchpoint.launchpointtype,
scriptlaunchpoint.launchpointname,
scriptlaunchpoint.objectname,
scriptlaunchpoint.active,
scriptlaunchpoint.objectevent,
trim(case when scriptlaunchpoint.objectevent between 2 and 1023 then ' onSave' else '' end ||
decode(bitand(scriptlaunchpoint.objectevent,1), 1, ' Initialize', '')||
decode(bitand(scriptlaunchpoint.objectevent,1024), 1024, ' App Validate', '') ||
decode(bitand(scriptlaunchpoint.objectevent,2048), 2048, ' Can Add', '') ||
decode(bitand(scriptlaunchpoint.objectevent,4096), 4096, ' Can Delete', '')) as "EVENT",
TRIM(decode(bitand(scriptlaunchpoint.objectevent,2), 2, ' Add', '') ||
decode(bitand(scriptlaunchpoint.objectevent,4), 4, ' Update', '') ||
decode(bitand(scriptlaunchpoint.objectevent,8), 8, ' Delete', '') ||
decode(bitand(scriptlaunchpoint.objectevent,16), 16, ' Add', '') ||
decode(bitand(scriptlaunchpoint.objectevent,32), 32, ' Update', '') ||
decode(bitand(scriptlaunchpoint.objectevent,64), 64, ' Delete', '') ||
decode(bitand(scriptlaunchpoint.objectevent,128), 128, ' Add', '') ||
decode(bitand(scriptlaunchpoint.objectevent,256), 256, ' Update', '') ||
decode(bitand(scriptlaunchpoint.objectevent,512), 512, ' Delete', '')) as "SAVE",
trim(case when (bitand(scriptlaunchpoint.objectevent,2) +
bitand(scriptlaunchpoint.objectevent,4) +
bitand(scriptlaunchpoint.objectevent,8) > 0) then ' Before Save' else '' end ||
case when (bitand(scriptlaunchpoint.objectevent,16) +
bitand(scriptlaunchpoint.objectevent,32) +
bitand(scriptlaunchpoint.objectevent,64) > 0) then ' After Save' else '' end ||
case when (bitand(scriptlaunchpoint.objectevent,128) +
bitand(scriptlaunchpoint.objectevent,256) +
bitand(scriptlaunchpoint.objectevent,512) > 0) then ' After Commit' else '' end) as "TIMING"
from scriptlaunchpoint
where scriptlaunchpoint.launchpointtype = 'OBJECT'
order by autoscript, launchpointtype, objectname
;


From: daveb_thomas (2018-03-26 10:18)

The SQL for MS Sql Server

-- Get Attribute Event
select scriptlaunchpoint.autoscript,
scriptlaunchpoint.launchpointtype,
scriptlaunchpoint.launchpointname,
scriptlaunchpoint.objectname,
scriptlaunchpoint.active,
scriptlaunchpoint.objectevent,
case when scriptlaunchpoint.objectevent & 0 = 0 then ' Validate' else '' end
+ case when scriptlaunchpoint.objectevent & 1 = 1 then ' Run action' else '' end
+ case when scriptlaunchpoint.objectevent & 2 = 2 then ' Initialize Value' else '' end
+ case when scriptlaunchpoint.objectevent & 8 = 8 then ' Initialize Access Restriction' else '' end
+ case when scriptlaunchpoint.objectevent & 64 = 64 then ' Retrieve list' else '' end as "EVENT"
from scriptlaunchpoint
where scriptlaunchpoint.launchpointtype = 'ATTRIBUTE'
order by autoscript, launchpointtype, objectname
;
-- Get Object Event
select scriptlaunchpoint.autoscript,
scriptlaunchpoint.launchpointtype,
scriptlaunchpoint.launchpointname,
scriptlaunchpoint.objectname,
scriptlaunchpoint.active,
scriptlaunchpoint.objectevent,
case when scriptlaunchpoint.objectevent between 2 and 1023 then ' onSave' else '' end
+ case when scriptlaunchpoint.objectevent & 1 = 1 then ' Initialize' else '' end
+ case when scriptlaunchpoint.objectevent & 1024 = 1024 then ' App Validate' else '' end
+ case when scriptlaunchpoint.objectevent & 2048 = 2048 then ' Can Add' else '' end
+ case when scriptlaunchpoint.objectevent & 4096 = 4096 then ' Can Delete' else '' end
as "EVENT",
case when scriptlaunchpoint.objectevent & 2 = 2 then ' Add' else '' end
+ case when scriptlaunchpoint.objectevent & 4 = 4 then ' Update' else '' end
+ case when scriptlaunchpoint.objectevent & 8 = 8 then ' Delete' else '' end
+ case when scriptlaunchpoint.objectevent & 16 = 16 then ' Add' else '' end
+ case when scriptlaunchpoint.objectevent & 32 = 32 then ' Update' else '' end
+ case when scriptlaunchpoint.objectevent & 64 = 64 then ' Delete' else '' end
+ case when scriptlaunchpoint.objectevent & 128 = 128 then ' Add' else '' end
+ case when scriptlaunchpoint.objectevent & 256 = 256 then ' Update' else '' end
+ case when scriptlaunchpoint.objectevent & 512 = 512 then ' Delete' else '' end
as "SAVE",
case when ((scriptlaunchpoint.objectevent & 2) + (scriptlaunchpoint.objectevent & 4)+ (scriptlaunchpoint.objectevent & 8)) > 0
then ' Before Save' else '' end
+ case when ((scriptlaunchpoint.objectevent & 16) + (scriptlaunchpoint.objectevent & 32) + (scriptlaunchpoint.objectevent & 64)) > 0
then ' After Save' else '' end
+ case when ((scriptlaunchpoint.objectevent & 128) + (scriptlaunchpoint.objectevent & 256) + (scriptlaunchpoint.objectevent & 512)) > 0
then ' After Commit' else '' end
as "TIMING"
from scriptlaunchpoint
where scriptlaunchpoint.launchpointtype = 'OBJECT'
order by autoscript, launchpointtype, objectname
;