Table 4: Constraint definitions for the Provide Quotation activity.

Constraints due to incoming XOR-merge–The preceding activity must be of type Ask Quotation or Change Quotation and must be completed
context ProvideQuotation inv: previous- size()=1 and previous->exists(a (a.oclIsTypeOf(AskQuotation) or a.oclIsTypeOf(ChangeQuotation) ) and a.status=completed’)
–No two instances may be related with the same Ask Quotation or Change Quotation instance
context Provide Quotation inv: ProvideQuotation.allInstances()-> isUnique(previous)
–A Provide Quotation instance follows each completed Ask Quotation or Change Quotation activity
context Case inv: status=completed’ implies activity- select(b b.oclIsTypeOf(Ask Quotation) or or b.oclIsTypeOf(ChangeQuotation))- forAll(b b.next->exists(a a.oclIsTypeOf (ProvideQuotation)))

Constraints due to the outgoing XOR- split –The next activity must be either another Change Quotation instance or a Submit Order instance, but not both
context ProvideQuotation inv: next->select (a a.oclIs TypeOf(Change Quotation) or a.oclIsTypeOf (SubmitOrder))->size()<=1
–If the Provide Quotation instance is completed, a Change Quotation or a Submit Order must necessarily be created before ending the case.
context Case inv: status=completed’ implies activity->select (a a.oclIsTypeOf (ProvideQuotation) and a.status=completed’)- forAll (a a.next- exists (b b.oclIsTypeOf(ChangeQuotation) or b.oclIsTypeOf(SubmitOrder)))
–Only Change Quotation activity instances or Submit Order instances may follow a Provide Quotation instance
context ProvideQuotation inv: next->forAll (b b.oclIsTypeOf(ChangeQuotation) or b.oclIsTypeOf(SubmitOrder)