Dynamics CRM 2015 Update 1 offers a new interesting capability. You can now interact diretcly without trying to get the process ID as we used to do in the previous versions. So the magic object is Xrm.Page.data.process
It allows you to get the current process by using ActiveProcess method or the active stage by using ActiveStage method. There are many amazing other methods that can be very useful. I invite you to try them, here is where you can find all of these methods: https://msdn.microsoft.com/library/dn817878.aspx
Hope you like it!