I've created a system using an AttachmentPointer BO which points to an AttachmentDocument BO. The AttachmentPointer BO contains the attribute OrderNumber. I store the actual attachments in the AttachmentDocument BO and attach records from AttachPointer to emails. This allows me to attach the same document to multiple emails, since I'm only attaching a pointer, rather than the actual document and the pointers can maintain independent OrderNumbers. Ridiculously complicated, but it should work...in theory!
Anyway, I'm experiencing a problem when I try to copy the the documents into the OutboundEmail notification. I'm copying each document in an independent rule using a FIND action unique to the document. However, when it sends out the email, I receive three attachments and all three are the same document. It appears as though when you execute a FIND action on a BO and then execute another FIND action on the same BO in a later rule, it ignores the second FIND and continues to use the result set from the first FIND. Here's the specific example I'm referring to:
Rule 1: FIND AttachmentPointer WHERE AttachmentPointer IN OutgoingEmail.AttachmentPointers AND AttachmentPointer.OrderNumber=1
OutboundEmail.Attachment1=AttachmentPointer.AttachmentDocument.Document
Rule 2: FIND AttachmentPointer WHERE AttachmentPointer IN OutgoingEmail.AttachmentPointers AND AttachmentPointer.OrderNumber=2
OutboundEmail.Attachment2=AttachmentPointer.AttachmentDocument.Document
Rule 3: FIND AttachmentPointer WHERE AttachmentPointer IN OutgoingEmail.AttachmentPointers AND AttachmentPointer.OrderNumber=3
OutboundEmail.Attachment3=AttachmentPointer.AttachmentDocument.Docume
I added two (not three) attachments to an email and sent it out. I also verified that the two documents I had attached were in fact different and that they were each stored in the database with a separate OrderNumber. The first document was stored with OrderNumber=1 and the second document was stored with OrderNumber=2. However, when I received the email, it contained three copies of the attachment from Rule 1.
Therefore, as I stated above, it appears as though Aware IM is ignoring the FIND action in Rules 2 and 3 and re-using the result set from Rule 1 for the subsequent rules.