I am hoping to check file names when a person checks a part into PDM works. Is there a central location to get information to set this up? I have the 2004_PDMWORKS stuff from SolidWorks but it sounds like that is outdated, and I'm not sure about setting up a MSMQ.
Thanks for any leads.
Dan Miel
SolidworksApi macros
Hi Dan,
You will need to setup an MSMQ Queue and for PDMWorks to send messages to. Once this is setup, you have two choices
1) Setup some queue rules that will be used to call an external program and this external program would do the file name check
2) Create a listening service hosted in a Windows Service that will monitor the queue for new messages. The listening service will listen for new queue message and will parse the messages to extract the required parameters for use in your checking function. This would run on the PDMWorks Service machine.
I wrote a listening service, like the one mentioned, a while back. I will try to dig it out for you so that you can add it into your application. It will be in VB.NET.
What exactly is you goal for this application/ use of triggers?
Cheers,
Declan
Declan
The problem that we are having is that we have a standard way of naming our Non-SolidWorks files that we store in the vault. This includes putting the revision number in the name so that they can be found in the FTP site. When a person needs to put the document in the vault they also need to put the old version into an obsolete project plus ensure that the new file name is correct. I'm thinking that I should be able to detect when someone is putting a new document in the vault and if it is not a SolidWorks document I can check the file name, get Description information and move the old documents for the engineers.
VB.Net is my preferred language. Is setting up the MSMQ a fairly easy procedure? Writting something to check the file names is easy and I have done a fair amount of PDM programming, it is the trigger that has me stumped at the moment.
Thanks
Dan
Hi Dan,
I was in the exact same situation and it took me ages to get things working. The MSMQ queue is pretty easy to get setup. Just make sure that MSMQ is installed on the PDMWorks Server machine and specify the MSMQ host machine name in PDMWorks Admin. If you look through the PDMWorks help file in theTriggers section you will get a list of the attributes that are passed in the XML based message when PDMWorks sends to the queue.
The MSMQ queue itself is setup using Control Panel, Administrative Tools, Computer Management. From here drill down into Services and Applications/Message Queuing. (see the attached image) Right click on the Private Queues folder, New/Private Queue and give the queue a name. Thats it.
You could create a standalone application that is called from the queue based on rules and triggers, but that could lead to a program being started and shutdown alot if alot of vault activity and could cause a resource issue on the server. I opted to create a listening service that I hosted in a Windows Service. (This was my stumbling block and it ages to get my head around it to get it working). In this way the application is always running and reacts to any messages that arrive onto the queue. Since the message format is XML based, you create an XML parser that extracts the attributes based on the content of the message, ie "createproject" or "deleteproject" or "checkin". These extracted attributes are then the inputs to your custom functions that perform the name check and moving of files. Also, if you didn't manually create the queue at the start you can programatically create it as part of the OnStart Event of the Windows Service.
eg. The "checkin" notification passes the following attributes in the message
Attribute
Description
document
Document name
revision
Revision level
project
Document’s project
user
User who checked in document
is_new
Value of 1 if the document is new to Workgroup PDM
Let me know if you need any assistance with the monitoring service and I will try to help if I can.
Cheers,
Declan.
Hi Dan,
I have done some digging around and I have a sample of a monitoring service. This was just the test service I created a while back and so the code is bit messy. Have a look and hopefully it may be of use to you as a possible starting point. I have also attached two batch files in the second zip file. These can be used to install and uninstall the windows service rather than having to type stuff at a command prompt.
Cheers,
Declan.
Declan
I took a look at the files and they look like what I need to get going on this project. You mention the Triggers section of the PDMWorks and I’m guessing that these help files are on the server. It may be a few days before I get going on this project but I want to thank you for taking the time to reply and for the files you included.
Dan Miel
Hi Dan,
I'm glad to be of assistance. It took me ages to get it working or at least onto the right track with the project I was working on. Let me know if you need any other help.
I am working on an entirely new "framework" project with the purpose of managing MSMQ messages and interacting with the vault or external SQL database. It will take me several weeks, as I am working on it in my spare time, however there is huge potential for what can be achieved.
I will keep you posted.
Cheers,
Declan.
declan,
can this program also be used to send email alerts when someone checks-in updated files to pdmworks?
thanks,
dave