locked
How to get current version from DefinitionIdentity? RRS feed

  • Question

  • Hi all,

    following this sample provided in MSDN:

    http://msdn.microsoft.com/en-us/library/hh314045.aspx

    I'm using xamlx services using IIS and  I'd like somehow to read the current version of a workflow to save it in an external database to keep tracking of which version is being used by my business entity id X.

    Is there out of the box way of getting this information?

    I know that I can read the XAMLX definition by using XamlServices.Load but my purpose is when the instance starts, get this information, store it once, persist it and it's done!

    Friday, October 18, 2013 9:29 AM

Answers

All replies

  • Hi,

    You can try getting the workflow instance id by querying the activity context (context.WorkflowInstanceID) from your CodeActivity.Execute override, and then you could pass than along to your logger component.

    For more information, you can refer here

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/5938c374-58a2-48fb-a6f6-85e157ab38a6/get-the-current-workflow-instance-id-in-a-wf4-workflow-service

    Hope it can help you.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 21, 2013 1:42 AM
  • Hi Pengzhen thank you for your feedback, however I don't want to trace the workflow instance ID, what I actually want is in a code activity to get the current version from workflow identity definition (for example 1.0.0.0) so I can then do whatever I want with it, but I don't find any support to get that information.

    The only way I found so far is to read the Xaml file definition by using XamlServices.Load method (which reads the xamlx file) however seems to me not too elegant to do that (I should be aware of the current version, seems to me a simple information I'm trying to get).

    Monday, October 21, 2013 10:12 AM
  • I found a resource about how To load WF4 Workflow Services from a Database with IIS/AppFabric, maybe you can find your answer in the following article.

    http://blogs.msdn.com/b/rjacobs/archive/2011/06/15/how-to-load-wf4-workflow-services-from-a-database-with-iis-appfabric.aspx


    • Edited by Mernández Friday, October 25, 2013 7:08 AM
    • Marked as answer by Pakojones Tuesday, December 12, 2017 5:07 PM
    Friday, October 25, 2013 7:07 AM