Optional: Implementing the Add Suggested Article gadget
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 Add Suggested Article 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 for use in your application, configure the following application settings.
- Verify that the following rules are in the application stack. If they are not,
then add these rules as described in Integrating the Pega Knowledge
rulesets in Preparing for the implementation.
- PegaKM
- PegaKMDiagnostics
- PegaKMInt
- PegaKMToggles
- KMReports
- PegaKMPortal
- 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
Add suggested articles to each flow of a case to display articles that are relevant to the current flow. The articles will change depending on the current flow.
- Extend the SetCurrentFlowActionDetails rule by entering
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. 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.
- Extend the KMSuggestedArticlesWrapper rule by setting the
FlowAction parameter value to
newAssignPage.pxFlowname. 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.
- Optional: If you want the suggested article to open in a new window:
- Remove or hide the second dynamic layout that holds the article, as shown in the following example:
- Open the KMSuggestedArticle rule.
- Open the Actions tab of the link that displays the article title.
- Remove the Refresh-Other section action, and then add the Launch Harness action.
- In the Using page field, enter KMSelectedSuggestedArticle.
- In the Class field, enter PegaFW-KM-Work.
- In the Harness field, enter DisplaySelectedArticleHarness.
- 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.
Adding suggested articles to an entire case
Add suggested articles to an entire case to display the same set of articles regardless of the current flow.
- Extend the SetCurrentFlowActionDetails rule by entering
the class name of the case type in the Source field, as
shown in the following example.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 display the same articles for the entire case regardless of the stage, open
the KMSuggestedArticlesWrapper rule and ensure that the
Flow Action parameter value is empty, as in the
following example:The KMSuggestedArticlesWrapper rule 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.
- Optional: If you want the suggested articles to open in a new window:
- Remove or hide the second dynamic layout that holds the article, as in the following example:
- Open the KMSuggestedArticle rule.
- Open the Actions tab of the link that displays the article title.
- Remove the Refresh-Other section action, and then add the Launch Harness action.
- In the Using page field, enter KMSelectedSuggestedArticle.
- In the Class field, enter PegaFW-KM-Work.
- In the Harness field, enter DisplaySelectedArticleHarness.
- 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.
Adding the Add Suggested Article 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.
- Open the pyWorkActionsPerform rule, and then add the Launch action.
- In the Local Action field, enter SuggestedArticlesFlowAction, as in the following example:
- Click OK.The suggested article option is added to the Actions menu.
- To search for a new article to add to the case, click .The Suggest article window opens, and any articles already added to the case are displayed in the Suggested articles added to the case section as in the following example:
- 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:
Previous topic Optional: Implementing the Search gadget Next topic Using Pega Knowledge REST APIs