var workflow = new Sequence();
Variable<Dictionary<string,object>> variable = new Variable<Dictionary<string,object>>
{
Name = "SharedData"
};
workflow.Variables.Add(variable);
foreach (MyCustomActivity activity in mAddedActivities)
{
workflow.Activities.Add(activity);
}
WorkflowInvoker invoker = new WorkflowInvoker(workflow);
invoker.Invoke();
이 내가 무슨 짓을 .. 뭔가 여기 ActivityResult는 다양한 추가 활동에서 공유 속성이 인터페이스 멤버의 일종을 통해입니다 !! 것인가, 오른쪽 방식으로하지 확신 나 제안 실제 구현에서는 인서트/아웃 테이션이 필요하지 않습니다. 변수 "공유 데이터"는 여러 작업에 걸쳐 데이터를 보유 할만큼 충분합니다.
재정의 된 코드 활동 "Execute"방법의 각 활동 수준에서이 워크 플로 변수 "SharedData"의 값을 가져 오거나 인출하기 위해이 코드 발췌 부분을 사용해야합니다. 이 다른 사람을 도움이 될
WorkflowDataContext dataContext = context.DataContext;
PropertyDescriptorCollection propertyDescriptorCollection = dataContext.GetProperties();
foreach (PropertyDescriptor propertyDesc in propertyDescriptorCollection)
{
if (propertyDesc.Name == "SharedData")
{
myData = propertyDesc.GetValue(dataContext) as Dictionary<string, object>;
if (myData == null) //this to check if its the initial(1st) activity.
myData = new Dictionary<string, object>();
//I'm adding here an additional value into the workflow variable
//its having signature same as that of workflow variable
//dictionary's key as what it is and value as an object
//which user can cast to what actually one wants.
myData.Add("islogonrequired", Boolean.TrueString);
//here I'm fetching some value, as i entered it in my previous activity.
string filePath = myData["filepath"].ToString();
propertyDesc.SetValue(dataContext, myData);
break;
}
}
희망 .. 거기에 자신의 도움말 해당 지원을 위해 다른 사람 감사합니다.
이 질문은 의미가 없습니다. NativeActivity에서 확장 된 활동을 만들 수 있다는 것을 충분히 알고 있다면 in/out 인수, 변수 및 워크 플로 확장 기능이 작동하는 방식을 파악할 수 있어야합니다. – Will
안녕하세요 윌, 그 감각에 관한 것이 아니라, 여기에 방해가됩니다. 왜 그런 질문을 던지셨습니까, 당신의 말로는 그것은 무의미 할 수 있습니다.하지만 나에게는 뭔가 빠져있을 수도 있습니다. 당신이 그것에 대한 현명한 대답 , 나에게 알려줘, 나에게 도움이 될지도 모른다. 귀하의 도움으로 의견을 수렴 할 수 있습니다. –
그런 다음 작업 1의 아웃 바운드를 워크 플로의 변수에 바인딩 한 다음 작업 2의 인수를 동일한 변수에 바인딩합니다. – Will