Tuesday, July 23, 2013

Access Violation at Address in Module 'AMEngine.dll'

The error (the title) was received one day when working on a task that deals with Excel. Network Automation tech support and I worked on resolving this for about ten days to find out that the error was the name of the Excel worksheet. The error that BPA Server returns is not all that helpful when troubleshooting but the message itself makes sense. Basically you are telling Excel to write to a nonexistent worksheet, which it does not like.

If we break down the error:

  • Access Violation
    • This is because you are attempting to write somewhere that you can't. (It doesn't exist!)
  • At address
    • is where it was trying to write (presumably on the disk, not verified) at.
  • in Module 'AMEngine.dll'
    • AMEngine.dll is the dynamic library this is telling it how to perform the Excel write.
      • After doing some research, the AMEngine.dll seems to be the Automate Task Interpreter.


If you see this error when writing to an Excel workbook, check your worksheet names!​

Wednesday, July 10, 2013

File Conditions/Trigger

In BPA Server we need to be very careful when we are using file conditions and file triggers. There is a large distinction between a file trigger and a file condition.
  • File Trigger
    • A file trigger is a file "condition" used at the beginning of a workflow. This is used to kick off the entire workflow.
      • ONLY THE BEGINNING
    • To make a file "condition" a trigger, we set it to Wait for Condition and to wait Indefinitely.
    • Once the condition is true, the workflow will store information about that file in the AMTrigger object.
      • In the expression builder, this can be found in the Objects -> Triggers -> File System folder.
  • File Condition
    • A file condition is a file "condition" used anywhere BESIDES the beginning of the work flow. These can be used throughout the workflow as a Wait so that it will not continue until a file condition is met.
      • IN THE MIDDLE
    • To make a file "condition" a condition, we set it to Timeout after. Setting the time will change how long the file condition will check for a file. After that period it will stop the workflow.
    • Once the condition is true, the workflow will store information about that file in the AMCondition object.
      • In the expression builder, this can be found in the Objects -> Conditions -> File System folder.

Tuesday, July 2, 2013

CAML Query - SharePoint Action Automate Server

I have been working with a product called BPA(business process automation) Automate Server 9 for about 9 months now and I am finally starting to get comfortable with using the tool proficiently. I am using this tool to improve efficiency and reduce human error in processes that we have not been able to remove the human element from. One very neat use is with SharePoint and moving list items between lists, more specifically lists that are not in the same SharePoint site. With that said, I still have my fair share of mistakes and screw ups because let's face it...I'm human! This leads us to the meat of this post, shall we?

In BPA Automate 9(BPA), we can use CAML queries to help us interact with SharePoint Lists and libraries. I needed a CAML query that would limit the number of records to more accurately filter the data returned by SharePoint to improve the efficiency of my workflow. My goal was to avoid looping through all the list items on a SharePoint library because I only needed a list of the files, not folders.

There are a few things that helped me. The first thing is the following link, http://msdn.microsoft.com/en-us/library/dd582942(v=office.11).aspx. This allowed me to see what I needed in my query, using the Query section. The other thing that helped me is a program called CamlDesigner, which can be downloaded from http://sharepoint.biwug.be/Pages/Downloads.aspx. There is more information on how to use this at this link, http://www.camldesigner.com/?p=596.

There are some syntactical problems with using CAML when you are unfamiliar, as I am. I am posting a CAML query below that shows the format that BPA needs it in. The values in "" can all be change as long as the values are real and match what they are in SharePoint.

<View><Query><Where><Eq><FieldRef Name="FSObjType" /><Value Type="Integer">0</Value></Eq></Where></Query></View>


One of the first things that someone who is familiar with SharePoint and CAML queries will notice is that it is not formatted the way you would expect. It cannot be formatted like a normal markup language. It needs to be tight and without spaces like above. (I know, it doesn't seem to make much sense. I can only think that BPA formats it later so they want it in a nice neat string before they format it.)