2014-11-05 54 views
0

我想根据以下标准检索以下自定义工作流程Contacts在自定义工作流的参数中列出<>?

[Input("Retrieve customers whose renewal date is lesser or equal than today + X days")] 
public InArgument<int> Days { get; set; } 

[Input("For which service?")] 
public InArgument<string> Service { get; set; } 

而且我希望它返回如下:

[Output("Customers up for renewal")] 
public OutArgument<List<Contact>> Customers{ get; set; } 

我的想法是,另一个工作流步骤将通过这一工作流程什么回报(Customers)循环。

但当我注册了装配,上述步骤无法注册,因为:

The type OutArgument`1 of the property Customers is not supported 

支持哪些类型的参数呢? MSDN没有告诉我多少,是我返回一个列表错误的概念还是一个工作流程一次只能处理一条记录?

谢谢。

回答

2

自定义工作流程活动可以使用OutArgument只有一组类型,并且没有类型(例如EntityCollection)将多个项目作为单个OutArgument返回。

因为您想要返回Contact的列表,所以可以使用静态Marketing List作为解决方法。

内,您的自定义工作流活动创建一个新的市场营销列表,并把联系人的列表的成员(市场营销列表只能与联系人使用,账户或潜在客户),并作为EntityReference返回列表编号:

[Output("List of Contacts")] 
[ReferenceTarget("list")] 
public OutArgument<EntityReference> MarketingListRef { get; set; } 


// code to create the marketing list and add the contacts 
Guid marketingListId; 

// set the OutArgument 
EntityReference marketingListRef = new EntityReference("list",marketingListId); 
MarketingListRef.Set(executionContext, marketingListRef); 
0

我找到属性here的支持类型列表。我想我将不得不重组我的工作流程,以便在内部处理Customers的列表,因为此列表不会显示给其他工作流程步骤。

+0

您可以返回包含联系人的新静态营销列表。也许不是最佳的,不知道你的整个情况,但没有工作 – 2014-11-05 16:45:42

+0

@GuidoPreite你可以详细解释一个答案吗?我在上面发布的MSDN链接中看不到这种类型。谢谢。 – 2014-11-05 16:51:00

相关问题