?>Array ( [lang] => en [id] => 38 )
Scénario de test & Cas d'usage
Define the initial version (v1) of the recommendation engine action set.
| 1 | PROC CAS; |
| 2 | ACTION BUILTINS.defineActionSet / |
| 3 | name='recommendationEngine' |
| 4 | definition={{ |
| 5 | ACTION='getRecommendations', |
| 6 | parms={{name='userId', type='string'}}, |
| 7 | code='print("v1: Getting recommendations for user " .. _parms_["userId"]);' |
| 8 | }}; |
| 9 | RUN; |
| 10 | QUIT; |
| 1 | PROC CAS; |
| 2 | ACTION BUILTINS.actionSetToTable / |
| 3 | actionSet='recommendationEngine' |
| 4 | casOut={name='RECOMMENDER_METADATA', caslib='casuser'}; |
| 5 | RUN; |
| 6 | QUIT; |
| 1 | PROC CAS; |
| 2 | ACTION BUILTINS.defineActionSet / |
| 3 | name='recommendationEngine' |
| 4 | definition={{ |
| 5 | ACTION='getRecommendations', |
| 6 | parms={{name='userId', type='string'}, {name='maxResults', type='int', defaultValue=10}}, |
| 7 | code='print("v2: Getting top " .. _parms_["maxResults"] .. " recommendations for user " .. _parms_["userId"]);' |
| 8 | }}; |
| 9 | RUN; |
| 10 | QUIT; |
| 1 | PROC CAS; |
| 2 | ACTION BUILTINS.actionSetToTable / |
| 3 | actionSet='recommendationEngine' |
| 4 | casOut={name='RECOMMENDER_METADATA', caslib='casuser', replace=true}; |
| 5 | RUN; |
| 6 | QUIT; |
| 1 | PROC CAS; |
| 2 | ACTION TABLE.fetch / |
| 3 | TABLE='RECOMMENDER_METADATA'; |
| 4 | RUN; |
| 5 | QUIT; |
The action runs successfully in both instances. After step 3, the 'RECOMMENDER_METADATA' table is overwritten. The final fetch in step 4 shows the v2 definition of the 'getRecommendations' action, which now includes the 'maxResults' parameter, confirming the lifecycle update was successful.