Implementing the Add Suggested Article gadget in your application
Use the Add Suggested Article gadget in your application to link contextual articles that help in resolving a flow or a step in a case, or an entire case. The linked articles provide relevant information related to the case in progress. For example, in a home loan case, a linked article might provide information about current interest rates or eligibility criteria.
- Configuring the gadget
- Adding suggested articles to each flow of a case
- Adding suggested articles to the entire case
- Adding the gadget in your application
Configuring the gadget
To use the gadget in your application, configure some application-level settings, and then extend the required rules. You can implement the gadget in your application in two ways:
- If you add suggested articles to each flow of a case type, the articles change depending on the current flow.
- If you add articles to an entire case, the articles remain the same regardless of the current flow.
Configuring application settings
To enable the gadget, perform the following steps:
- Verify that the following rules are in the application stack. If they are not, then add these rules as described in the Implementing the Pega Knowledge rulesets section of the Pega Knowledge Implementation Guide.
- PegaKM
- PegaKMDiagnostics
- PegaKMInt
- PegaKMToggles
KMReports
PegaKMPortal
2. Add the SuggestedArticlesOverRides rule to the additional style sheets in the skin rule of your application.
Adding suggested articles to each flow of a case
To add suggested articles to each flow of a case, extend the required rules.
- Extend the SetCurrentFlowActionDetails rule:
SetCurrentFlowActionDetails is a data transform that populates the articles that you add to the gadget. This rule has two property Set actions. The first action is automatically populated by the class of the case type for which you configure the gadget, and the second one is the flow name.
- Enter newAssignPage.pxFlowName in the Source field for the flow name. This action dynamically picks up the flow name and shows only those articles in the gadget that are related to that flow.
- Extend the KMSuggestedArticlesWrapper rule:
KMSuggestedArticlesWrapper holds data about the suggested articles. In this section, the table is populated from the D-SuggestedArticles data page, which has two parameters: CaseTypeClassName and FlowAction.
- Set the FlowAction parameter value to newAssignPage.pxFlowname, as in the following example:
- Optional: If you want the suggested article to open in a separate window:
a. Remove or hide the second dynamic layout that holds the article, as in the following example:
b. Open the KMSuggestedArticle rule.
c. Open the Actions tab of the link that displays the article title.
d. Remove the Refresh-Other section action, and then add the Launch Harness action.
e. In the Using page field, enter KMSelectedSuggestedArticle.
f. In the Class field, enter PegaFW-KM-Work.
g. In the Harness field, enter DisplaySelectedArticleHarness.
4. Add suggested articles to a case type by extending the SuggestedArticleFlowAction. You can specify this flow action for any section that has access to a case context.
Example: Adding suggested articles to each flow of a case type
The following screens show the result of adding suggested articles to each flow of a case type when the flow differs from stage to stage and requires different articles for each stage. Notice that different suggested articles appear at the Loan request and the Loan approval stages in the loan process. In this example, SuggestedArticleFlowAction is added in pyWorkActionsPerform.
Adding suggested articles to an entire case
To add suggested articles to an entire case, extend the required rules:
- Extend the SetCurrentFlowActionDetails rule:
SetCurrentFlowActionDetails is a data transform that populates the articles that you add to the gadget. This rule has two property Set actions. The first action is automatically populated by the class of the case type for which you configure the gadget, and the second one is the flow name.
- To configure all flows with the same set of articles, enter the class name of the case type in the Source field, as in the following example:
- To configure all flows with the same set of articles, enter the class name of the case type in the Source field, as in the following example:
- Extend the KMSuggestedArticlesWrapper rule,
KMSuggestedArticlesWrapper holds data about the suggested articles. In this section, the table is populated from the D-SuggestedArticles data page, which has two parameters: CaseTypeClassName and FlowAction.
- To display the same articles for the entire case, regardless of the stage, ensure that the FlowAction parameter value is empty, as in the following example:
3. Optional: If you want the suggested articles to open in a separate window:
a. Remove or hide the second dynamic layout that holds the article, as in the following example:
b. Open the KMSuggestedArticle rule.
c. Open the Actions tab of the link that displays the article title.
d. Remove the Refresh-Other section action, and then add the Launch Harness action.
e. In the Using page field, enter KMSelectedSuggestedArticle.
f. In the Class field, enter PegaFW-KM-Work.
g. In the Harness field, enter DisplaySelectedArticleHarness.
4. Add suggested articles to a case type by extending the SuggestedArticleFlowAction.
You can specify this flow action for any section that has access to a case context.
Example: Adding suggested articles to an entire case
The following screens show the result of adding articles to an entire case, regardless of the stage in the current case flow. Notice that the suggested articles remain the same during the Loan request and Loan approval stages in the loan process.
Adding the gadget in your application
Add the gadget in your application to link contextual articles that help in resolving a flow or a step in a case, or an entire case. You can add the gadget in the application in multiple ways, for example, as a menu option, a button, or a link.
The following steps provide instructions on how to add the gadget as an option in the Actions menu in your application.
Open the pyWorkActionsPerform rule, add then add the action.
- In the Local Action field, enter SuggestedArticlesFlowAction, as in the following example:
- Click
The suggested article option is added to the menu. . - To search for a new article to add to the case, click Actions > Add suggestedarticle.
The Suggest article window opens, and any articles already added to the case are displayed in the Suggested articles added to the case section.
- In the Search content field, enter an article title, and then click Submit.
Displaying recently added articles in a case
You can display recently added suggested articles in the case immediately after adding them.
- Open the pyWorkActionsPerform rule.
- Add the Refresh Other section action below the Launch action, as in the following example:
Viewing suggested articles and other case data
You can add the KMSuggestedArticlesWrapper section to sections such as pyCaseMainInner to see the suggested articles that are configured along with other case data.
- Open the section where you want to add the gadget.
- In the target section, add the KMSuggestedArticlesWrapper section, as in the following example.
Example: KMSuggestedArticlesWrapper added in the pyCaseMainInner section
Previous topic Additional Pega Knowledge articles Next topic Implementing the Search gadget in your application