Many uses cases entail batch processing of portfolios, such as:
The QBO Decision module now includes a series of Product classes to handle such batch ordering.
Decide what "products" are to be made available by inserting ProductTemplate rows. For example, assume that EventID 27 is a Contact-based Military Search event:
To make all QDS-related events products:
Setting up Contact-based Portfolios
From the GMAC Batch 001 portfolio, click on the Products tab. This will execute pProductListByTemplate list all Product Templates that apply to the Collection.
When you click on a Product hyperlink, a web service call to execute pProductLaunch is called. This will:
Note that this EventQueue row is not the Military Search event; it's an event to process some ProductMember!
Now wait for completion!
The "real work" of batch processing is being done by the ProductMember class. When you "launch" a Product, a ProductMember row is created for each CollectionMember row, and then an EventQueue row is created for each ProductMember. At this point, the Event Queue Service takes over by processing the ProductMember events.
The ProductMember ProcessEvent method will process the underlying IDecisionStep class as it executes. This is not the normal Decision Queue processing that workflow does. Instead, the ProductMember class uses the same factory to create an "underlying object" that the DecisionStep class does. No DecisionStep row is created or required.
If the underlying class is an event, it will be fired synchronously.
If the underlying class is an IDecisionStep class, it will have ProcessStep called, and choose to complete itself or not, as it sees fit. If the class reports itself as completed, the ProductMember will be marked completed as well.
The pProductMemberUpdate stored procedure will update the Product table indicating a SuccessCount and FailureCount, so as they are executed, the Product table reflect the current status of the "batch"
In some cases, order of one Product may be inappropriate until completion of another Product. This can be configured with a DecisionTemplate. In this case, the DecisionTemplate is being used to define dependencies, but is not used to actually create new Decision rows. The pProductListByTemplate stored procedure accepts a @DecisionTemplateID parameter, and includes 'DependencyPending' and 'DependencyComplete' columns. The UI does not allow a user to create a new Product unless the 'DependencyComplete' column is NULL.