I'm working on a workflow in which I'm calling a custom activity. After the call of the custom activity I'm trying to get properties which have been changed in the custom activity in my UpdateApprovers method.
The problem is that when I'm outside my activity, and try to access some properties of my activity, I don't get the changes I made, I just have the initialization value. This is the declaration of my properties : public static DependencyProperty listEtapeChoisieProperty = DependencyProperty.Register("listEtapeChoisie", typeof(List), typeof(ActivityLibrary.EtapeOuiNon));
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
[BrowsableAttribute(true)]
[CategoryAttribute("Misc")]
public List<DefEtape> listEtapeChoisie
{
get
{
return ((List<DefEtape>)(base.GetValue(ActivityLibrary.EtapeOuiNon.listEtapeChoisieProperty)));
}
set
{
base.SetValue(ActivityLibrary.EtapeOuiNon.listEtapeChoisieProperty, value);
}
}
public static DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(System.String), typeof(ActivityLibrary.EtapeOuiNon));
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
[BrowsableAttribute(true)]
[CategoryAttribute("Misc")]
public String Title
{
get
{
return ((string)(base.GetValue(ActivityLibrary.EtapeOuiNon.TitleProperty)));
}
set
{
base.SetValue(ActivityLibrary.EtapeOuiNon.TitleProperty, value);
}
}
This is the initialization of my activity
etapeOuiNon1.listEtapeChoisie = new List<DefEtape>();
etapeOuiNon1.Title = "Titre";
During the activity I have this code, which update both properties :
private void choixEtapeOuiNon_ExecuteCode_1(object sender, EventArgs e)
{
Title = "new title";
if (visa)
{
foreach (DefEtape etape in EtapeEnCours.EtapeOui)
{
listEtapeChoisie.Add(etape);
}
}
else
{
foreach (DefEtape etape in EtapeEnCours.EtapeNon)
{
listEtapeChoisie.Add(etape);
}
}
visa = false;
isFinished = false;
}
And finally in my UpdateApprovers I'm trying to get the changed value :
private void UpdateApprovers_Execute(object sender, EventArgs e)
{
Title = etapeOuiNon1.Title
foreach (DefEtape etape in etapeOuiNon1.listEtapeChoisie)
{
Approvers.Add("test");
j++;
}
}
But doing this, I only have 0 values in listEtapeChoisie, and etapeOuiNon1.Title is still "Titre".
Do you have any ideas how I can make this two activities communicate ? Thanks for the help :)