RE: Business Process Flows data model in Dynamics 365 Online
I found some additional information (thanks for the tips above from David and Alex).
The Workflow entity stores a business process flow definition. So once the entity is created, it is always in Draft state and its definition is stored in Workflow entity. XAML property is where the definition is stored and is mandatory/required.
Once you activate a business process flow definition (by changing the state of the corresponding Workflow entity record), a custom entity with the following name is automatically created to store the activated business process flow instances: "<activesolutionprefix>_<uniquename>".
Here is the code to retrieve active path for a process and the current and next stages on the process:
// Retrieve the active stage ID of in the active process instance
_activeStageId = new Guid(activeProcessInstance.Attributes["processstageid"].ToString());
// Retrieve the process stages in the active path of the current process instance
RetrieveActivePathRequest pathReq = new RetrieveActivePathRequest
{
ProcessInstanceId = _processOpp2Id
};
RetrieveActivePathResponse pathResp = (RetrieveActivePathResponse)_serviceProxy.Execute(pathReq);
More details in this MSDN article:
msdn.microsoft.com/.../dn481586.aspx
Workflow entity definition:
msdn.microsoft.com/.../mt622427.aspx
Hope this helps anyone trying to get better understanding of Business Process Flows new Model (version 8.2 December 2016 release. This community discussion is now worth a blog post!