Hi @PraveenMankala @VikasRaidhan @sandd1 and @Tharun_K_T ,
Thank you for your responses and for reviewing the configuration.
I have made a few changes to the flow design, and the issue is now resolved. However, I would like to share some observations from my troubleshooting and understand the underlying reason for this behaviour.
Scenario 1: Send Email shape before Assignment
Initially, my Service Case flow had the Send Email (acknowledgement) shape first, followed by an Assignment shape.
With this configuration, comprehensive email tracking did not work. In Tracer, D_ChannelHistory was called with ObjectKey:"null", and .pxEmailCaseKey was always blank. As a result, pyTrackEmails skipped the tracking path; there was no exception.
Scenario 2: Separate processes within the Service Case
I then split the flow into two processes:
- Process 1: an Assignment to collect the required information.
- Process 2: send the acknowledgement email. This process starts automatically when Process 1 completes.
D_ChannelHistory now loaded with the correct key and returned 1 row, but tracking still failed. The following exception occurred, and the case moved to the Problem flow:
Exception caught while evaluating when
Encountered an error while executing a Scalar value query for Scalar, .pxEmailCaseKey,
on page 'pyWorkPage' of type 'Booking-INSCMP-Work-Service-Complaints'
at pyTrackEmails step3 ← SendSimpleEmail step24 ← pzSendEmail ← AckToCustomer
← pzStartStageFlow ← pyDefault ← pzOnProcessEnd ← CompleteAssignment
Caused by: java.lang.ClassCastException:
com.pega.platform.clipboard.adapters.internal.LegacyPageAdapter cannot be cast to
com.pega.pegarules.data.internal.clipboard.ClipboardPageBase
at ClipboardPageBase.getMessagesAll
at PropertyDataPageWrapper.populateDataFromPage (auto-populate of Work-.cxChannelHistory)
at pxGetValueInPageListWithNorm (Declare Expression .pxEmailCaseKey)
The same exception occurred with Tracer on and off. It also appeared in the logs on the Constellation view refresh for that case.
Scenario 3: Assignment followed by Send Email in a single process
Finally, I configured a single process with the Assignment shape first, followed by the Send Email shape. With this configuration, email tracking worked, and the sent email appeared in the Email Interaction thread as expected.
My questions
- Why does the sequence of the Assignment and Send Email shapes, or splitting them into different processes, affect the value of
pxEmailCaseKey and the comprehensive email tracking behaviour?
- Is there a specific context, parameter, or case association (for example, the Channel History record) that is established once the Assignment is executed and that
pyTrackEmails depends on? If so, what is the recommended way to send a tracked acknowledgement immediately after case creation?
- Is the
ClassCastException in Scenario 2 a known issue when a process is started via pzOnProcessEnd/pzStartStageFlow? I noticed that Work-.cxChannelHistory resolves from PegaCS-Channel-Constellation 08-23-01, while D_ChannelHistory and pyTrackEmails resolve from 08-25-01.
I would appreciate understanding the underlying mechanism so that I can design the flow correctly, rather than relying solely on this particular sequence of shapes. I’m happy to share the full Tracer and log files if helpful.
Thanks again for your support.