|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |
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. Get the SAL form session handle, which identifies the particular work item. You can do this using the GETHANDLE(2) function.
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.
The FORMCONTROL function can be placed anywhere in the step, as it does not take effect until the script has finished.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)
EXITInstead of using WINRUN, you can also call the Open Forms application using DDE. You may want to use DDE if, for example:
• You want to avoid the overhead involved in starting the Open Forms application each time a form is opened.
• You want to run your Open Forms application as a service, continually processing forms as required.
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. Use DDEEXECUTE to pass the tools window handle and SAL form session handle to the Open Forms application.For more information about the available DDE functions, see TIBCO iProcess Expressions and Functions Reference Guide.
|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |