Welcome to GuerillaProgrammer.com Sign in | Join | Help

Syndication

Tags

    No tags have been created or used yet.
Hands on Grinder 1

This is a really simple example of Grinder. In this case I’m just going to move a file from one directory to another and rename it in the process.

First, start the workflow designer and create a new workflow. Drag the file copy activity on to the workflow. In the properties area set the Source File Path to ${FULLPATH} and set the destination file path to c:\temp\test\output1\${FILENAME}_${CLIENTID}${EXT}. Now save the workflow and then build it.

clip_image002

Once the workflow has been built go to the configuration editor. Open the existing Configuration.xml file (it will be in Grinder’s folder under Program Files). Now right click on Workflows and select add workflow:

clip_image004

Give the workflow a name. Then click the ellipse button next to the strong name text box. This will let you select the workflow assembly you want. Because a single assembly can contain several workflows you will be asked to select the workflow in the assembly:

clip_image006

After you named your workflow and selected the workflow from an assembly click the update button. We are now ready to setup a file type.

Right-click File Types and select Add File Type. Give you file type a name. Specify the file pattern that will be used to pickup the files. For instance if you are going to process work documents with Grinder you would use *.doc as your file pattern. Then from the drop down select the workflow that will be used to process the files. After you have done that click update.

Now go to directories and add a new directory to monitor by right clicking and selecting Add Directory. Give the directory a name, choose the path (C:\temp\test\client1). Then select the types of files to find in the directory, you can choose as many as you like.

We also want to add a CLIENTID property to the directory so Grinder can use that information during processing (remember how we setup the FileCopy?). Click on properties and add a new property. In the properties form – first click add, then click on the new property. The change its name and value and click update. Then click the Update button at the bottom.

clip_image008

After you have added your property and closed the dialog click update to save the changes to the directory. Now save the configuration file.

We have now done everything we need to do in order to run our sample – mostly. First – create the directories you are going to be using (C:\temp\test\output1 and c:\temp\test\client1). If you just installed Grinder it will not be running yet. Either go to the services control panel and start it or use the Grinder Monitor to start it.

After Grinder starts it will eventually scan the directories for files to be processed. When that happens you will see the file *.docx you created disappear from the client1 directory. If you go look in the archive directory you’ll see it. You will also see it in the output1 directory renamed with the CLIENTID you entered.

This is probably the absolute easiest thing to do with Grinder. Hopefully though it give you a small inkling of what it can really do.

Published Tuesday, April 29, 2008 5:21 PM by jakew

Comments

No Comments

Anonymous comments are disabled