process from rules

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Rebecca
Posts: 21
Joined: Fri May 27, 2005 12:46 am

process from rules

Post by Rebecca »

Is it possible to run a process from a rule? We have created the
> following rule in Purchase Order object:-
> If PurchaseOrder.Supplier.PurchaseContract IS DEFINED AND
> PurchaseOrder.Supplier.PurchaseContract.DateFinish>=CURRENT_DATE Then
> PurchaseOrderSpecialPricing
> The PurchaseOrderSpecialPricing process is as follows:-
> DISPLAY QUESTION ' <<PurchaseOrder.Supplier>> has a special pricing
> contract with WMI. Do you want to see deatails of this contract?'
> If Question.Reply='Yes' Then
> VIEW PurchaseOrder.Supplier NOEDIT
> When we try to enter an order which activates this rule, the above
> question is not displayed, and the following message appears
> Unable to serialize process context com.bas.shared.data.ObjectReference
> Orders can be entered normally if the supplier does not have a purchase
> contract which requires the rule to run.
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

The message about being unable to serialize process context was caused by a problem in the software that has now been fixed.

While it is definitely possible to run a process from a rule attached to an object, please keep in mind that object rules can be executed at any time when the object data is changed. For example, if you change a product price, it may cause re-calculation or order items for this product, and that in turn would cause execution of rules on purchase orders to which the items belong. That would cause execution of your rule because its conditions would be satisfied.

Also, the VIEW action does not wait for user's input, so if the Create Order process has its next rule to display the order form to the user, the system will probably skip over Supplier form in the rule 'VIEW PurchaseOrder.Supplier NOEDIT'.

If you want to show the supplier contract to the user before the user starts entering the order, instead of using the rule you could do the following:
a) show the supplier contract as a step of Create Order process, and
b) show the supplier contract as a document - not a form - so it would be displayed in a separate browser without disrupting the order creation workflow. The document would be a report dynamically generated from a template based on the same details as shown on the Supplier form.

Here is an example of the Create Order process:
1. PICK FROM Supplier
2. IF Supplier.PurchaseContract.DateFinish>=CURRENT_DATE Then DISPLAY QUESTION '<<Supplier.Name>> has a special pricing contract with WMI. Do you want to see details of this contract?'
3. If Question.Reply='Yes' Then DISPLAY DOCUMENT 'Supplier contract'
4. ENTER NEW PurchaseOrder WITH PurchaseOrder.Supplier=Supplier

If you already have a supplier contract as a document stored with the Supplier object, then instead of dynamically generating a report from template you could simply show the document to the user, so step 3 in the process would look like this:

3. If Question.Reply='Yes' Then DISPLAY DOCUMENT Supplier.ContractDocument

Alternatively, you could add an operation 'View Contract' to the Supplier attribute table when it appears on the PurchaseOrder form - if the supplier has a current contract. You could use a different font and colour (say bold/red) to draw user's attention to the special Supplier status. When the user clicks on the hyperlink the operation would show the contract document. In this case you would not need step 2 and 3 in the above example.
Aware IM Support Team
Post Reply