Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 7 Using Open Forms : Creating the Script to Call the Open Forms Application

Creating the Script to Call the Open Forms Application
See "Creating Scripts" in TIBCO iProcess Modeler Advanced Design for more information about creating and editing scripts.
You must create a script which will call the Open Forms application when the step is opened. The script must do four things:
1.
Get the tools window handle, which identifies the iProcess login session that the work item belongs to. You can do this using the GETHANDLE(5) function.
2.
3.
Call the Open Form application, passing the tools window handle and SAL form session handles as parameters. You can do this using the WINRUN function.
4.
Hide or abort the iProcess Form window for this step. You can do this using the FORMCONTROL function:
Use FORMCONTROL (4) to hide the window. Any Keep or Release command defined for the step will be run when the form is kept or released.
Use FORMCONTROL (0) to abort the window. Any Keep or Release command defined for the step will not be run when the form is kept or released.
An example script is shown below. The relevant function calls are pointed out and shown in bold for clarity.
; -------------------------------------------------------------
; Example script to call an Open Form application SWEMAIL.EXE
; -------------------------------------------------------------
;
; Get the tools window handle.
;

toolshwnd:= gethandle(5)

; Get the SAL form session handle.
;

salformsh := gethandle(2)

; Call SWEMAIL.EXE and pass the tools window handle and SAL form
; session handle.
;

if winrun ("SWEMAIL.EXE" + str(toolshwnd,0) + " " +
str(salformsh,0),1) < 33
Messagebox ("SWEMAIL","SWEMAIL.EXE failed",4,0)
formcontrol(2) ; KEEP - put item back in work queue.
EXIT
endif

; Hide the Form window - any Keep/Release command will be run.
; (formcontrol(0) would abort the Form window.)
;

formcontrol(4)

EXIT
Using DDE to Call the Application
Instead of using WINRUN, you can also call the Open Forms application using DDE. You may want to use DDE if, for example:
One way of using DDE calls would be:
1.
Use DDECONNECT to ‘wake up’ the Open Forms application. (If the call fails because the application is not running you can then start it using WINEXEC.)
2.
3.
For more information about the available DDE functions, see TIBCO iProcess Expressions and Functions Reference Guide.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved