Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Issue while using Text Analytics and Declare Trigger together



User is using Text Analytics capability (PegaNLP - 07.10 ruleset) on Pega 7.2 platform and is trying to build a Social Media Complaint Analysis application.

This application has to listen to social media, analyze if contents are negative and if so, invoke resolution actions.

User has used Data Set and Data Flow to dynamically receive tweets and facebook posts, get the sentiments and store in PR_DATA_NLP_SUMMARY Table.

Next user has written a Declare Trigger on this table (of class Data-NLP-Report-Summary) to invoke resolution case whenever new tweet or post is recorded in database table.

The issue is, if user keep the option "Trigger When an Instance is" as SAVED then it always process the second last record (for example, second last row or last tweet or post which was saved a minute back).

If COMMITTED SAVE is selected, sometimes it does not save the record in PR_DATA_NLP_SUMMARY table at first instance, sometimes it fetches the last record and invokes the case multiple times.

Error Messages

Not applicable

Steps to Reproduce

  1. Create Data Set, Data Flow and Free Text Model to get posts from Twitter.
  2. Create a sample case with resolution steps in case designer.
  3. Add a Trigger in Data-NLP-Report-Summary table, trigger activity to invoke the case.

Observe that the Trigger activity always process second last record irrespective of "Trigger When an Instance is" option is committed save or save.

Also "COMMITTED SAVE" option sometimes stop the system to save the social media record from Data Flow (in table PR_DATA_NLP_SUMMARY).

Root Cause

The case creation feature is available within the Data Flow itself instead of calling the Declare Trigger.


Follow below steps to create a resolution case based on the sentiment analysed on a Tweet within the Data Flow -

Invoking case creation within Data Flow:
  1. Add a Filter component after the “Free Text Model”.
  2. Create a Negative Sentiment Filter.
  3. Add a condition “.NLPOutcome.pyOverallSentiment = Negative”.
  4. Add additional destination to a Case. 

In this scenario after the sentiment analysis, it has a filter which does a Negative sentiment which saves into the summary as well as it creates a case. 

To capture the Positive sentiment as well; filter could be modified as below:

In order to process the sentiment on the texts which resides on the database table column, following needs to be performed:

  1. Create a new Data Set.
  2. Select the type as Database Table which applies to Database class.
  3. Select the Database columns.

In order to analyze the specific property say “InputText”, one must create a free text model in the same applies to class.

Map the Outcome to a Single Page property which is defined on Data-NLP-Outcome class.

Once done need to create the Data Flow in the same class, in similar way as mentioned above.

Published August 25, 2016 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us