Suggestion.
either:
a) Add a public (readonly) property to ImportQueueItem, that after ImportQueueItem.Process(), holds the underlying business object. or
b) Add a alternative function to ImportQueueItem, that returns the object.
My scenario: I'm going to have quotes and orders in my queue, and for some, I would like to do a bit more than just load them into Jiwa. Since ImportQueueItem doesn't expose the details of an item that's been Process()ed, I'm going to have to load them manually. I'll still use ImportQueueItem to get the XML out of the database, but I'll be manually loading up the objects by checking the XML header, and then processing them accordingly.
On the other hand, if ImportQueueItem had say, a 'BusinessObject' property (presumably of type JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.Maintenance) that contained a JiwaSalesOrder object, then I could just use that object to perform further processing.
Presumably, in Process(), you're instantiating business objects in order to load the XML, so all I'm asking is that the object you instantiate be exposed outside of ImportQueueItem.
Looking at the existing object definition, conceptually, it could be a bit like:
- Code: Select all
Public Function ProcessQueueItem() As Maintenance
Dim result As Maintenance
' <code from Process()>
Return result
End Function
Sub Process()
' discard output
ProcessQueueItem()
End Sub
The method would have to fail if the item has already been processed (probably an InvalidOperationException).
Also, it would be helpful for troubleshooting to have some more specific feedback going into IM_ImportQueue. Perhaps a 'Class' field and 'RecID' field that are populated as part of the Process function.