Beruflich Dokumente
Kultur Dokumente
Content
1. LIST OF TOOLS AND APPLICATION USED 3
3. QUERY 4
4. MACRO 5
5. STEPS 8
6. NOTE: 9
Generate Visio Flow Chart from IBM Maximo
Original macro downloaded from following site, Did some modification to meet specific
requirement.
https://www.mrexcel.com/forum/excel-questions/651691-create-visio-document-excel-
using-vba.html
Generate Visio Flow Chart from IBM Maximo
3. Query
select
wfnode.nodeid "Step",
case
when wfnode.nodetype = 'START' then 'Start/End'
when wfnode.nodetype = 'CONDITION' then 'Decision'
when wfnode.nodetype = 'TASK' then 'Process'
when wfnode.nodetype = 'SUBPROCESS' then 'Subprocess'
when wfnode.nodetype = 'INPUT' then 'Data'
when wfnode.nodetype = 'STOP' then 'Start/End'
when wfnode.nodetype = 'INTERACTION' then 'Frame' end "Node",
wfnode.title "Node Title",
case when wfaction.ispositive = 1 then wfaction.membernodeid else null end "Connect 1",
case
when "Connect 2" is not null then 'Yes' else null end "Connect 1 Text",
"Connect 2",
"Connect 2 Text",
wfcondition.condition,
wfaction.action,
wfaction.instruction,
wfaction.condition wfactioncond
from wfnode left join wfaction
on wfaction.processname = wfnode.processname and wfaction.processrev = wfnode.processrev and
wfaction.ownernodeid = wfnode.nodeid
left join wfcondition on wfcondition.processname= wfnode.processname and
wfcondition.processrev=wfnode.processrev and wfcondition.nodeid=wfnode.nodeid
left join (select wfaction.membernodeid "Connect 2",wfaction.ownernodeid,wfnode.nodetype,'No' "Connect 2
Text"
from wfnode inner join wfaction
on wfaction.processname = wfnode.processname and wfaction.processrev = wfnode.processrev
and wfaction.ownernodeid = wfnode.nodeid
left join wfcondition on wfcondition.processname= wfnode.processname and
wfcondition.processrev=wfnode.processrev and wfcondition.nodeid=wfnode.nodeid
where wfnode.processname = 'CHANGE'
and wfnode.processrev = 1 and wfaction.ispositive = 0) a on a.ownernodeid =
wfaction.ownernodeid and a.nodetype = wfnode.nodetype
where wfnode.processname = 'CHANGE'
and wfnode.processrev = 1 and (wfaction.ispositive = 1 or wfaction.ispositive is null)
group by
wfaction.ownernodeid,wfnode.nodeid,wfnode.nodetype,wfaction.ispositive,wfaction.membernodeid,wfnode.titl
e,"Connect 2","Connect 2 Text",wfcondition.condition,
wfcondition.condition,wfaction.action,wfaction.instruction,wfaction.condition
order by wfnode.nodeid
Generate Visio Flow Chart from IBM Maximo
4. Macro
Option Explicit
Sub CreateLinkedVisioBoxesForColumn1Data()
'For each cell in column A starting in A1, create a rectangle in Visio and connect to the next box
Dim lLastRow As Long
Dim aryRowData() As Variant
MsgBox "Complete"
End Sub
bAllInSameVisio = True
sngDeltaX = 2.5
sngDeltaY = 2
sngX = 1.25
sngY = 13.5
If bAllInSameVisio Then
'Is Visio already running
On Error Resume Next
' Check whether PowerPoint is running
Set AppVisio = GetObject(, "Visio.Application")
Generate Visio Flow Chart from IBM Maximo
'Set stencil
AppVisio.ActiveWindow.Page.Drop AppVisio.Documents.Item("Favorites.vssx").Masters.ItemU(Cells(lShapeIndex,
2).Value), sngX, sngY
'Set primary id of shapes
'AppVisio.ActiveWindow.Selection.PrimaryItem.ID = Cells(lShapeIndex, 1).Value
lCurrDropIndex = AppVisio.ActiveWindow.Selection.PrimaryItem.ID
SetShapeText lCurrDropIndex, CStr(Cells(lShapeIndex, 3).Value)
Next
Shape = Row - 1
End Function
Function DoAutoConnect(fromShape As Object, toShape As Object, dir As Integer, ctext As String) As Integer
5. Steps
1. Use attached query to extract data from workflow objects and arrange data with following
required columns as below format please make sure to add last blank row manually.
Name Flow chart symbol Text Connects 1 Connect 1 Text Connects 2 Connect 2 Text
1 Start/End START 1 9
2 Start/End STOP 2
3 Decision MINOR? 4 Yes 5 No
4 Frame NOAPPROVE 9
5 Decision SIGNIF? 6 Yes 13 No
6 Process MANAGER 7 Yes 12 No
7 Process AREAS 8 Yes 12 No
8 Process APPROVED 2
9 Decision VALID? 3 Yes 10 No
10 Frame INVALID 9
12 Process REJECTED 3 Yes 2 No
13 Process MANAGER1 15 Yes 12 No
14 Process AREAS 8 Yes 12 No
15 Process CAB 14 Yes 12 No
16
2. Run attached macro, which will create a visio diagram with flowchart, which you can improve
with auto spacing and available design format in visio.
MANAGER No
START 1 Yes
Yes AREAS No
Yes No REJECTED
APPROVED AREAS
Yes
Yes
STOP 2 Yes
No No
MINOR? No SIGNIF? No MANAGER1
CAB
Yes
Yes VALID?
NOAPPROVE
INVALID
Generate Visio Flow Chart from IBM Maximo
6. Note:
Add all required shapes to visio favorite
Search “PATH” word in attached Macro file and replace it with actual path of
Favorite.vssx, usually you will find it under C:\Users\*****\Documents\My Shapes\
Favorites.vssx.
Update attached query with process name and its version.