Child CUWOs
Sometimes a CUWO running on a device A needs to spawn a CUWO on device B. For example, a CUWO running on a merchant-controlled device may require UI interaction with a customer. In those cases, it is usually not feasible for the merchant to hand over the device to the customer as it may be physically impossible and is also problematic as it may give the customer access to merchant-only information/operations.
Therefore, the enfore platform provides CUWOs with ways to spawn child CUWOs on other devices.
Specifically, a CUWO can spawn "customer-level UI" CUWOs on devices that are configured as customer-level devices. The setup usually consists of pairs of merchant-controlled devices (e.g., an enforeDasher or enforeComet or Mac/Windows/Linux device) and customer-level devices (e.g., enforeDonner or enforeComet) that are bound via configuration. Nevertheless, a customer-level device may be used for more than one merchant-controlled device but then is still limited to serve one customer-level CUWO at a time. It is also possible that no customer-level device is paired to a specific merchant-controlled device, in which case the merchant will be presented with a list of suitable devices (at the current service location) to chose on which device the customer-level CUWO shall be started.
Spawning a child CUWO
Child CUWOs are spawned by special operations such as the SpawnCustomerLevelUIChildCUWOOperation
operation. Such an operation causes the specified CUWO to be spawned on the target device. As operation result, the parent CUWO receives a handle of the spawned child CUWO. And the child CUWO receives a handle of the spawning parent CUWO as part of its workflow parameters.
Terminating a child CUWO
A child CUWO may terminate itself at any time, in which case the parent CUWO will receive the result data via a ChildCUWOTerminated
message.
The parent CUWO may also trigger the termination of the child CUWO via a TerminateChildCUWOOperation
operation. This will result in the child CUWO receiving a TerminationRequested
message and then being terminated. Note that the parent CUWO will receive both a ChildCUWOTerminated
and an OperationFinished
message once the child CUWO has been terminated:
As usual, the child CUWO may respond to the TerminationRequested
with a TerminationConfirmationMessage
message. This message will be shown to the user on the device that runs the parent CUWO as that is the person that requested the termination. Depending on the user's decision, the child CUWO may either be terminated or not. In case of the termination being aborted, the child CUWO is not terminated and the TerminateChildCUWOOperation
is resolved with an OperationFinished
with status CANCELED_BY_USER
. Otherwise, the spawned CUWO is terminated and the TerminateChildCUWOOperation
is resolved with an OperationFinished
with status COMPLETED
.
Sending messages
The parent and child CUWOs have "cuwo handles" of each other that can be used to send messages between them via the PassMessageToCUWOOperation
operation.
Note that the data sent via PassMessageToCUWOOperation
is processed by the enfore platform as it needs to be transported from one device to another. Therefore, it must not contain confidential information such as user credentials. If such data must be exchanged between the CUWOs, this should ideally be done via an external shared infrastructure controlled by the CUWO provider
If shared infrastructure is not an option, the critical data must at least be encrypted before sending it via PassMessageToCUWOOperation
.