|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Trigger Monitor |
« View previous topic :: View next topic » |
Author |
Message
|
Carla Viragh |
Posted: Fri Oct 31, 2003 4:51 am Post subject: Trigger Monitor |
|
|
 Voyager
Joined: 31 Oct 2003 Posts: 92 Location: São Paulo - Brasil
|
Hello, I´m brasilian and I work as a MQ consultant (only administration) in a bank. Só... sorry if my english is not so good...
Please, I´m using trigger monitor to start wordpad and I configured the process to open a file (I specifÃed the full file path in the ENVRDATA(C:\teste.txt)) but when the trigger starts, it opens the wordpad and brings additional parameters before the path, so, the wordpad is not able to open the file. I verified that the trigger monitor structure is strange and realy brings this additional parameters by default... How can I open my file with wordpad? Do I need to create a special trigger monitor to do this simple question? _________________ Carla Viragh |
|
Back to top |
|
 |
mb5278 |
Posted: Fri Oct 31, 2003 5:07 am Post subject: |
|
|
Novice
Joined: 20 Oct 2003 Posts: 10
|
The information is passed to the triggered app in the form of MQTMC2 structure. The information you are expecting (the filename) is not the first argument, therefore you got an error. To overcome this, create a shell script (cmd) which will parse the arruments and pass the result to notepad. the tmc2 structure:
s/*********************************************************************/
/* MQTMC2 Structure -- Trigger Message 2 (Character) */
/*********************************************************************/
typedef struct tagMQTMC2 MQTMC2;
typedef MQTMC2 MQPOINTER PMQTMC2;
struct tagMQTMC2 {
MQCHAR4 StrucId; /* Structure identifier */
MQCHAR4 Version; /* Structure version number */
MQCHAR48 QName; /* Name of triggered queue */
MQCHAR48 ProcessName; /* Name of process object */
MQCHAR64 TriggerData; /* Trigger data */
MQCHAR4 ApplType; /* Application type */
MQCHAR256 ApplId; /* Application identifier */
MQCHAR128 EnvData; /* Environment data */
MQCHAR128 UserData; /* User data */
MQCHAR48 QMgrName; /* Queue manager name */
So you should substring the argument from 428 for 128 in your example. It is also recommended that you get the message out after trigger is successful.
Matt |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 31, 2003 5:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The standard trigger monitor supplies the MQTMC2 structure as the first command line argument to a process when it launches that process.
Instead of launching Wordpad directly, create a batch or command file that will launch WordPad, and set the process definition to run the batch file.
This is a command that would work for you in a batch file
Code: |
"c:\Program Files\wordpad" %2 |
Or whatever the path to your wordpad.exe is. This says 'run wordpad and give it the second argument passed into this batch file as it's first argument'. Then keep your environment data the same. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
raj.in |
Posted: Fri Oct 31, 2003 5:35 am Post subject: |
|
|
Novice
Joined: 15 Sep 2003 Posts: 10 Location: India
|
I presume you are in Windows O/S .Please try this and reply ...
a) set APPLICID to the complete path of executable (ie, c:\program files\windows nt\Accessories\worpad )
b) set APPLTYPE ( WINDOWS or WINDOWSNT)
c)USERDATA (here the file you wish to open which ,TM pass this as parameter to the started application )
cheers ,
:)raj. |
|
Back to top |
|
 |
Carla Viragh |
Posted: Fri Oct 31, 2003 8:17 am Post subject: Thanks! |
|
|
 Voyager
Joined: 31 Oct 2003 Posts: 92 Location: São Paulo - Brasil
|
Well... I created a batch file, thanks very much. I was looking for a good forum for a long time and finaly I found it! Thanks. _________________ Carla Viragh |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|