|
mass email of messages from msmq (pdmworks workgroup)
hello,
our company is in process of implementing pdmworks workgroup in our system. we have setup the triggers as well as msmq service and everything is functioning correctly.
we would like to know if there's a sample script (or how we would go about writing one), to read xml messages from the queue, and e-mail them to whomever.
we've done some research on this subject, where most relevant result was regarding msmq exchange connector, but this is only applicable up to windows nt (we're using 2003)
any help is greatly appreciated,
vedran ikonic
edited: 06/27/2008 at 04:04 pm by vedran ikonic
i wouldn't like to leave this thread in the dust,
i just wanted to say i was able to come up with the code that will retrieve messages, extract needed data, store them in an html doc that will be e-mailed at a later date.
if someone needs help with this, let me know.
thanks
hi
i would very much like to see the script you have wrritten.
i'm just about to try and do exactly what you have done.
i want to to work on revision change but there isn't a simple trigger have you any suggestions.
thanks
john sutton
you should be able to monitor the "modifycustomproperty". when it is the revision custom property that has changed, do something.
wayne matus
texas engineering systems
thanks
i'll give it a try as soon as i can. busy with drawings at the mo.
i too could do with a 'crash course' in the use of workgroup triggers. our it department has just installed the msmq on the server (and we've turned it on in valutadmin), but i don't know how to pick up the xml messages - where are they?
a few sample bits of vb would be really useful. can i still do it in vb6 (i don't really have time for a .net upgrade at the moment). this would be most useful as if i can't notifiy a particular set of users when documents are up-issued, pdmww is practically dead in the water.
thanks very much for your help.
simon, here is a link to some samples in vb6.
i must say that solidworks documentation on triggers is a bit lacking probably a lot you really need to understand msmq and a programming language to understand it. but i've got this far and seeing what i could now use triggers for it was worth the effort.
private sub monitorqueue() handles timer.tick
count = count + 1 'count of polling the queue
txtcounter.text = count.tostring
dim queue as new messagequeue()
queue.path = ".\private$\pdmworks"
queue.formatter = new activexmessageformatter 'use this for solidworks
dim qenum as messageenumerator
qenum = queue.getmessageenumerator2
while qenum.movenext 'read all messages
dim m as message = qenum.current
dim reader as system.xml.xmlreader = system.xml.xmlreader.create(new system.io.stringreader(m.body))
reader.readtofollowing("header")
strtype = reader.getattribute("type") ' get type of trigger
reader.readtofollowing(strtype)
strdocument = microsoft.visualbasic.ucase(reader.getattribute("document"))
strdocumentorig = microsoft.visualbasic.ucase(reader.getattribute("document"))
strrevision = microsoft.visualbasic.ucase(reader.getattribute("revision"))
struser = microsoft.visualbasic.ucase(reader.getattribute("user"))
strstatus = reader.getattribute("status")
select case strtype
case "checkin"
'messagebox.show("checkin message")
checkin()
m = queue.receive(new timespan(1000)) ' delete message comment out for debugging
case "changedocstatus"
'messagebox.show("change status message")
strstatus = reader.getattribute("new_value")
changedocstatus()
m = queue.receive(new timespan(1000)) ' delete message comment out for debugging
end select
end while
end sub
great! thanks john,
i will have a play with that in a while. i don't know why solidworks seem so reluctant to give out useful information about triggers when they are so useful and greatly extend the functionality of both/either pdm product. indeed pdm api help in general seems to have gone all naff lately.
i did a presentation at sww 2008 in san diego about programming triggers. the presentation includes a sample vb.net 2005 express edition project. i did not include one for email because i did not want to be responsible for someone hijacking your mail server, but what i have should be able to help you. if you would like a copy of it, please send me an email at wmatusattexasengineering.com.
wayne matus
texas engineering systems |
|