Skip to main content


 

Symptoms


Assume you are trying to use OOB SmOs from WorkflowReports/WorkflowGeneral category (ActivityInstanceDestination, ProcessData, ProcessInstance) in notifications which are sent out to workflow users.
When notification email is being created at asynchronous points in workflow these SmOs do not return any data, but later data is being returned by those SmOs.
For example when test workflow starts it receives FQN of a user to whom email will be sent and populates it with information from WorkflowGeneral SmO. If this process run multiple times, SmOs return different SmOs execution results: sometimes all data is returned, sometimes only part of it and sometimes no data returned. But if you immediately after this call SmO with the same parameters – all data will be returned.

As a workaround to this problem with empty results returned from SmO you can just repeat a call to an SmO after short period of time. But this is not a best solution obviously which creates unnecessary load on server. Questions:

1. Why when WorkflowGeneral SmOs being used the data is being returned with delay?
2. Does this behavior means that data returned by SmO ProcessData in asynchronous point of process can be outdated?
3. What can be (if any) right solution for retrieving required data in “real time”?
 

Diagnoses


There is a delay here because reporting data is using different tables and the tables need some time for syncing. Process data is written to a log queue and processed at a later stage. On extremely busy host servers it can take up to an hour before the data is available through Workflow Reporting Services. All the data that gets written to the reporting databases is already available in the Workflow process itself and should be queried against the process to get the "real time" data.

1. Why when WorkflowGeneral SmOs being used the data is being returned with delay?
It takes some time to generate the report, but the best way to find the reason behind this is to enable SMO logging and check the logs.

2. Does this behavior means that data returned by SmO ProcessData in asynchronous point of process can be outdated?
Yes as the report gets generated when it starts executing the SMO. But it should be just a few seconds or less.
3. What can be (if any) right solution for retrieving required data in “real time”?
There is no way to retrieve "real time" data from the process with reporting SmOs. All the data that gets written to the reporting databases is already available in the Workflow process itself and should be queried against the process to get the "real time" data.
 

Resolution

Reporting SmOs require some time to generate reports on process instance thus calling them from process instance for getting some data about it not always works. In order to get "real time" access to process data from the process Workflow process itself should be queried.




 
Be the first to reply!

Reply