|
<< Click to Display Table of Contents >> Navigation: Advanced Features > Integrated Workflow Module > Logical components > The Events Scripts |
The events scripts are enlisted in the Scripts view of the Workflow Designer.
Two special scripts manage the events of the Workflow Module. They are:
Manages the event of changing the current Workflow State in a process for a particular document.
Input:
@DOCUMENT_UNIQUE_ID |
the document unique id |
|---|---|
@ECO_ID |
the ECO_ID |
@PROCESS |
the Workflow Process name assigned to the document |
@FROM_STATE |
the state from which the process comes from |
@TO_STATE |
the state to which the process goes to |
@FROM_STATE_INDEX |
the index ( 0..N ) of the state from which the process comes from |
@TO_STATE_INDEX |
the index ( 0..N ) of the state to which the process goes to |
@SILENT |
0/1 ( 1 if no input should be required ) |
Output:
@EVENT_LOG_NOTES |
optional notes that will be inserted in the event log table |
|---|---|
@EVENT_LOG_FILE_ATTACHMENTS |
optional file attachment that will be inserted in the event log table; this file attachment will be available to the workflow user interface for opening and for tracking all the red-linings along the workflow process |
Example:
.VBSCRIPT
const eDrawingsRoot = "W:\eDrawings\"
sub main
DBWInit(TRUE)
silent = DBWInput("@SILENT")
ecoId = DBWInput("@ECO_ID")
process = DBWInput("@PROCESS")
fromState = DBWInput("@FROM_STATE")
toState = DBWInput("@TO_STATE")
docUid = DBWInput("@DOCUMENT_UNIQUE_ID")
if silent = 0 then
DBWMsgBox "Change State in process " & process & vbcrlf &_
"From=" & fromState & vbcrlf &_
"To:" & toState & vbcrlf &_
"Document Unique Id=" & docUid
myNotes = InputBox("Insert a note for this event:")
if myNotes<>"" then
DBWOutput "@EVENT_LOG_NOTES",myNotes,ForWriting
end if
'
' check for the availability of an eDrawing
'
Set fs = CreateObject("Scripting.FileSystemObject")
eDrawingID = ecoId + "_" + docUid
eDrawingPath = ""
tempPath = eDrawingsRoot + eDrawingID + ".EASM"
If (fs.FileExists(tempPath)) Then
eDrawingPath = tempPath
else
tempPath = eDrawingsRoot + eDrawingID + ".EPRT"
If (fs.FileExists(tempPath)) Then
eDrawingPath = tempPath
else
tempPath = eDrawingsRoot + eDrawingID + ".EDRW"
If (fs.FileExists(tempPath)) Then
eDrawingPath = tempPath
end if
end if
end if
set fs = nothing
if eDrawingPath<>"" then
DBWOutput "@EVENT_LOG_FILE_ATTACHMENT",eDrawingPath,ForAppending
end if
end if
end sub
Manages the event of sending a notification to the user(s) who submitted a document to the Workflow Module.
Inputs:
@USER_NAME |
the name of the user who submitted the approval request |
|---|---|
@WORKFLOW_PROCESS_RESULT |
0: rejected , 1: approved |
@DOCUMENT_UNIQUE_IDS |
list ( separated by blanks ) of the unique ids of the documents submitted |
Example:
.VBSCRIPT
sub main
DBWInit(TRUE)
userName = DBWInput("@USER_NAME")
workflowProcessResult = DBWInput("@WORKFLOW_PROCESS_RESULT")
documentUniqueIds = DBWInput("@DOCUMENT_UNIQUE_IDS")
DBWMsgBox "OnSendNotificationToUsers" & vbcrlf &_
"User Name:" & userName & vbcrlf &_
"Workflow Process Result:" & workflowProcessResult & vbcrlf &_
"Document Unique Ids:" & documentUniqueIds
end sub