3.2.7.10 Create Phase Zero Enlistment
The Create Phase Zero Enlistment event MUST be signaled with the following arguments:
An Enlistment object
If the Create Phase Zero Enlistment event is signaled, the Core Transaction Manager Facet (section 1.3.3.3.1) MUST perform the following actions:
If the transaction state of the transaction object referenced by the provided Enlistment object is Phase Zero (section 3.2.1.3.3):
The Core Transaction Manager Facet MUST:
Signal the Create Phase Zero Enlistment Success (see section 3.6.7.8 and section 3.7.7.6) event on the Enlistment object's transaction manager facet with the provided Enlistment object.
Signal the Begin Phase Zero (section 3.6.7.4 and section 3.7.7.3) event on the provided Enlistment object's transaction manager facet with the provided Enlistment object.
Otherwise, if the transaction state is Active (section 3.2.1.3.2) or Phase Zero Complete (section 3.2.1.3.4):
If the Next Phase Zero Wave Enlistment list of the transaction is empty:
Signal the Register Phase Zero (section 3.4.7.15) event on the transaction's superior enlistment's transaction manager facet with the transaction's Superior Enlistment object.
Otherwise, if the list is nonempty and the Phase Zero Registered flag of the transaction is true:
Signal the Create Phase Zero Enlistment Success (section 3.6.7.8 and section 3.7.7.6) event on the enlistment object's transaction manager facet with the Enlistment object.
Add the provided enlistment to the Next Phase Zero Wave Enlistment list of the transaction.
Otherwise: