简体   繁体   English

露天评估师,是否可以使用OR条件进行链接?

[英]alfresco evaluators, is it possible to chain with OR condition?

My question is simple, is it possible to have multiple evaluators chained with OR condition on an action? 我的问题很简单,是否可以在一个动作上将多个评估器与OR条件链接在一起?

For example I'd like to have an action defined with some evaluators, but instead of having them chained in AND condition, I would like the final result would be true if eval1 OR activeWorkflows are true. 例如,我想定义一个由一些评估器定义的操作,但是如果eval1或activeWorkflows为true,我希望最终结果为true,而不是将它们链接在AND条件下。

<action id="mark-as-custom" type="javascript" label="actions.mark-as-custom" icon="custom">
    <param name="function">onActionFormDialog</param>
    <param name="itemKind">action</param>
    <param name="itemId">markDocumentAsCustom</param>
    <param name="destination">{node.nodeRef}</param>
    <param name="mode">create</param>
    <param name="successMessage">actions.mark-as-custom.success</param>
    <param name="failureMessage">actions.mark-as-custom.failure</param>
    <permissions>
        <permission allow="true">Write</permission>
    </permissions>
    <evaluator>evaluator.doclib.action.IsMySite</evaluator>
    <evaluator negate="true">evaluator.doclib.document.eval1</evaluator>
    <evaluator negate="true">evaluator.doclib.indicator.activeWorkflows</evaluator>
    <evaluator negate="true">evaluator.doclib.action.isLocked</evaluator>
</action>

I know I can write a new java evaluator which can combine the single results with any wanted condition, but I wold like to know if there is a way to obtain that only trough xml configuration. 我知道我可以编写一个新的Java评估程序,该程序可以将单个结果与任何所需的条件结合起来,但是我很想知道是否有办法获得仅通过xml配置的方法。

Thanks 谢谢

Have you looked at the chainedMatchOne and chainedMatchAll evaluators? 您是否看过chainedMatchOne和chainedMatchAll评估程序? The chainedMatchAll would AND all of your evaluators together whereas the chainedMatchOne would OR them. chainedMatchAll将您的所有评估者与在一起,而chainedMatchOne将对其进行或。 Here's the doc on the out-of-the-box evaluators: https://docs.alfresco.com/5.2/concepts/doclib-predefined-evaluators-reference.html 以下是开箱即用的评估程序的文档: https : //docs.alfresco.com/5.2/concepts/doclib-predefined-evaluators-reference.html

You can grep the source for examples of ChainedMatchOne to see how it works. 您可以grep ChainedMatchOne示例的源代码来查看其工作原理。 Basically you'll just define a new evaluator in XML that specifies ChainedMatchOne as its parent, then you'll list the evaluators you want to be part of the evaluation. 基本上,您将只用XML定义一个新的评估程序,该评估程序将ChainedMatchOne指定为其父项,然后列出要加入评估程序的评估程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM