Pseudo-Algorithm for AddToFavoriteList
If the user is an anonymous user, End.
Get the Favorite List and Favorite List Item business components.
Query the Favorite List business component with the search specification
[Person Id] = LoginId
;If there is a existing record, go to step 4;
Else create a new record and set [Person Id] to current login ID.
Query the Favorite List Item business component with the search specification
[Product Id] = input product ID
;If there is an existing record, go to step 5;
Else create a new record and set [Product Id] to input product ID.
If GotoView input argument is not empty, navigate to the specified view and End;
Else check the Favorite List View user property in the Shopping Service business service:
If this value is empty, End;
Else navigate to this view and End.