WF 规则和 CodeTypeReferenceExpression
我将一些变量移入工作流程中的类中。
不幸的是,现在规则失败了,我一直在尝试设置类型,但不断收到此错误。
活动“ifRequestComplete” 验证失败:属性 “条件”的值无效。 条件表达式无效。这 指定类型名称(“请求, 审批工作流程”)不能 已解决。
没有 'ns0:CodeTypeReferenceExpression Type=".."/>'我收到这个错误
活动“ifRequestComplete” 验证失败:属性 “条件”的值无效。 条件表达式无效。这 类型字段“gReq” “ApprovalWorkflow.ApprovalFlow”确实 不存在或不可访问。
Request 类是在与工作流相同的项目中的 ApprovalWorkflow 命名空间中创建的,也称为 ApprovalWorkflow。
namespace ApprovalWorkflow
{
public class Request {...}
}
.rules 文件包含此内容
<RuleExpressionCondition Name="ifRequestComplete">
<RuleExpressionCondition.Expression>
<ns0:CodeBinaryOperatorExpression Operator="ValueEquality" xmlns:ns0="clr-namespace:System.CodeDom;Assembly=System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<ns0:CodeBinaryOperatorExpression.Left>
<ns0:CodeFieldReferenceExpression FieldName="StatusCode">
<ns0:CodeFieldReferenceExpression.TargetObject>
<ns0:CodeFieldReferenceExpression FieldName="gReq">
<ns0:CodeFieldReferenceExpression.TargetObject>
<ns0:CodeTypeReferenceExpression Type="Request, ApprovalWorkflow" />
<ns0:CodeThisReferenceExpression />
</ns0:CodeFieldReferenceExpression.TargetObject>
</ns0:CodeFieldReferenceExpression>
</ns0:CodeFieldReferenceExpression.TargetObject>
</ns0:CodeFieldReferenceExpression>
</ns0:CodeBinaryOperatorExpression.Left>
<ns0:CodeBinaryOperatorExpression.Right>
<ns0:CodePrimitiveExpression>
<ns0:CodePrimitiveExpression.Value>
<ns1:String xmlns:ns1="clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">COM</ns1:String>
</ns0:CodePrimitiveExpression.Value>
</ns0:CodePrimitiveExpression>
</ns0:CodeBinaryOperatorExpression.Right>
</ns0:CodeBinaryOperatorExpression>
</RuleExpressionCondition.Expression>
</RuleExpressionCondition>
我尝试了几种不同的方式来编写类型“Request”、“ApprovalWorkflow.Request”、“ApprovalWorkflow.Request、ApprovalWorkflow”,但似乎没有任何效果。
请帮忙。
I moved some variables into classes in my workflow.
Unfortunately, now the rules fail, I've been trying to set the Type, but keep getting this error.
Activity 'ifRequestComplete'
validation failed: Property
"Condition" has invalid value.
Condition expression is invalid. The
type name specified ("Request,
ApprovalWorkflow") can not be
resolved.
without the 'ns0:CodeTypeReferenceExpression Type=".."/>' I get this error
Activity 'ifRequestComplete'
validation failed: Property
"Condition" has invalid value.
Condition expression is invalid. The
field "gReq" on type
"ApprovalWorkflow.ApprovalFlow" does
not exist or is not accessible.
The Request class is created in the ApprovalWorkflow namespace in the same project as the workflow, also named ApprovalWorkflow.
namespace ApprovalWorkflow
{
public class Request {...}
}
the .rules file contains this
<RuleExpressionCondition Name="ifRequestComplete">
<RuleExpressionCondition.Expression>
<ns0:CodeBinaryOperatorExpression Operator="ValueEquality" xmlns:ns0="clr-namespace:System.CodeDom;Assembly=System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<ns0:CodeBinaryOperatorExpression.Left>
<ns0:CodeFieldReferenceExpression FieldName="StatusCode">
<ns0:CodeFieldReferenceExpression.TargetObject>
<ns0:CodeFieldReferenceExpression FieldName="gReq">
<ns0:CodeFieldReferenceExpression.TargetObject>
<ns0:CodeTypeReferenceExpression Type="Request, ApprovalWorkflow" />
<ns0:CodeThisReferenceExpression />
</ns0:CodeFieldReferenceExpression.TargetObject>
</ns0:CodeFieldReferenceExpression>
</ns0:CodeFieldReferenceExpression.TargetObject>
</ns0:CodeFieldReferenceExpression>
</ns0:CodeBinaryOperatorExpression.Left>
<ns0:CodeBinaryOperatorExpression.Right>
<ns0:CodePrimitiveExpression>
<ns0:CodePrimitiveExpression.Value>
<ns1:String xmlns:ns1="clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">COM</ns1:String>
</ns0:CodePrimitiveExpression.Value>
</ns0:CodePrimitiveExpression>
</ns0:CodeBinaryOperatorExpression.Right>
</ns0:CodeBinaryOperatorExpression>
</RuleExpressionCondition.Expression>
</RuleExpressionCondition>
I've tried several different ways of writing the type "Request", "ApprovalWorkflow.Request", "ApprovalWorkflow.Request, ApprovalWorkflow", nothing seems to work.
Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现,当修改底层对象时,它们从字段更改为属性,并且生成的 .rules 文件必须相应更改。
I figured it out, when modifying the underlying objects they changed from fields to properties and the resulting .rules file had to change accordingly.