locked
Access parent activity properties from a child activity RRS feed

  • Question

  • Hi Folks

    I have a small issue at the moment where I am trying to access the parent activities type and displayname within a child activity.

    I plan to add a custom nativate activity in to the trigger of a Transition between to States in a StateMachine. I would like to make sure that firstly my activity can only be places in the trigger designer window, so require to validate the parent type is of type triggeraction or transition and then I would like to get the transition "DisplayName" from the parent also. I cannot seem to get this info from within my activity. Any ideas where I should look for this info? I see that the NativeActivityMetadata contains some private info about it but I can't access it.

    Any ideas on how I could achive this?

     

    Thanks

    Steve

    
    
    Tuesday, November 22, 2011 1:19 PM

Answers

  • In what method are you trying to access the parent? If you're doing it during validation, there's a mechanism accessible for that- you can create a new instance of GetParentChain, and pass in the current validation context- That should give you access to the parent-

     

    • Marked as answer by SDMIT Friday, November 25, 2011 11:05 AM
    Wednesday, November 23, 2011 2:38 AM
  • Hi,

     

    You can create constraint to meet the requirement you have.

    It show how you can restrict activities dropped onto and you can access properties of parent Activity.

    http://stackoverflow.com/questions/8016606/how-do-i-use-system-activities-validation-getparentchain

     

    Regards,

    Madhur


    MB
    • Marked as answer by SDMIT Friday, November 25, 2011 11:05 AM
    Wednesday, November 23, 2011 5:03 PM

All replies

  • In what method are you trying to access the parent? If you're doing it during validation, there's a mechanism accessible for that- you can create a new instance of GetParentChain, and pass in the current validation context- That should give you access to the parent-

     

    • Marked as answer by SDMIT Friday, November 25, 2011 11:05 AM
    Wednesday, November 23, 2011 2:38 AM
  • Hi,

     

    You can create constraint to meet the requirement you have.

    It show how you can restrict activities dropped onto and you can access properties of parent Activity.

    http://stackoverflow.com/questions/8016606/how-do-i-use-system-activities-validation-getparentchain

     

    Regards,

    Madhur


    MB
    • Marked as answer by SDMIT Friday, November 25, 2011 11:05 AM
    Wednesday, November 23, 2011 5:03 PM
  • Thanks folks,

    Searching for "GetParentChain" posted by Patrick brought up the link you suggested Madhur and resolved my issue.

    Friday, November 25, 2011 11:06 AM