In a previous post, I have discussed retrieving information from the PPS WebServices, namely, retrieving the system information, that returns information on the Applications stored within PPS. To retrieve any further data from PPS WebServices, we need to know the application ID, which is returned from the GetSystem() method.
Once you have retrieved the applications, you may notice that there are not a huge amount of WebServices methods available for use. This is because one WebServices is used to retrieve most data from PPS. Again we are going to use the MetaDataManager.asmx, WebServices, and the method we can use is the Request method, that expects an object called a PerformancePointRequest, and in turn returns a PerformancePointResponse. A PerformancePointRequest can be made to retrieve all sorts of information from PPS, and this is always returned to a PerformancePointResponse. Here is an example of code that returns Cycle instance information.
MetaDataManager.QueryFilter ppQueryFilter = new MetaDataManager.QueryFilter();
ppQueryFilter.ResultDataType = MetaDataManager.ReferenceDataType.CycleInstances;
MetaDataManager.QueryWorkflowData performancePointRequest = new MetaDataManager.QueryWorkflowData();
performancePointRequest.TargetObjectId = ApplicationID;
performancePointRequest.QueryFilter = ppQueryFilter;
MetaDataManager.PerformancePointResponse ppsResp = ppsMDM.Request(performancePointRequest);
return ppsResp;
So the PerformancePointResponse will return a standard object that can be successfully cast to a number of different objects, I have not used all objects as yet, however we have most experience with the ‘WorkflowDataResponse’ object. So casting the PerformancePointResponse object, to a ‘WorkflowDataResponse’ object, we know have a Workflow Data Object that is a set of data tables that re compressed. So.. To get the data we need to de-compress this. The following shows how I have gone about decompressing this:
First we need to get the Table Schema, that is compressed:
public static DataTable UnpackTableSchema(byte[] packedTableSchema)
{
DataTable table2 = new DataTable();
XmlSerializer dataTableSerializer = new XmlSerializer(typeof(DataTable));
if (packedTableSchema == null)
{
return null;
}
DataTable table = null;
using (MemoryStream stream = new MemoryStream(packedTableSchema))
{
using (GZipStream stream2 = new GZipStream(stream, CompressionMode.Decompress, true))
{
table = dataTableSerializer.Deserialize(stream2) as DataTable;
}
}
table2 = table;
}
return table2;
}
Once we have the unpacked schema, we can unpack the data and load it against the schema:
There are quite a few methods to actually unpacking the data, so if you are interested please do not hesitate to contact me. Also, once we have finished the product, it will be available for download at https://adatis.co.uk. Should you like to take a look at our BETA please email us at devteam@adatis.co.uk.
Introduction to Data Wrangler in Microsoft Fabric
What is Data Wrangler? A key selling point of Microsoft Fabric is the Data Science
Jul
Autogen Power BI Model in Tabular Editor
In the realm of business intelligence, Power BI has emerged as a powerful tool for
Jul
Microsoft Healthcare Accelerator for Fabric
Microsoft released the Healthcare Data Solutions in Microsoft Fabric in Q1 2024. It was introduced
Jul
Unlock the Power of Colour: Make Your Power BI Reports Pop
Colour is a powerful visual tool that can enhance the appeal and readability of your
Jul
Python vs. PySpark: Navigating Data Analytics in Databricks – Part 2
Part 2: Exploring Advanced Functionalities in Databricks Welcome back to our Databricks journey! In this
May
GPT-4 with Vision vs Custom Vision in Anomaly Detection
Businesses today are generating data at an unprecedented rate. Automated processing of data is essential
May
Exploring DALL·E Capabilities
What is DALL·E? DALL·E is text-to-image generation system developed by OpenAI using deep learning methodologies.
May
Using Copilot Studio to Develop a HR Policy Bot
The next addition to Microsoft’s generative AI and large language model tools is Microsoft Copilot
Apr