mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-2157] Fixed structure, markup and links (#904)
* [ACA-2157] Added brief description and updated links * [ACA-2157] Fixed broken image URL
This commit is contained in:
@@ -6,7 +6,9 @@ Title: Creating custom evaluators
|
||||
|
||||
Rule evaluators are plain JavaScript (or TypeScript) functions that take `RuleContext` references and an optional list of `RuleParameter` instances.
|
||||
|
||||
Application provides a special [RuleEvaluator](https://github.com/Alfresco/alfresco-content-app/blob/master/src/app/extensions/rule.extensions.ts#L30) type alias for evaluator functions:
|
||||
Application provides a special
|
||||
[RuleEvaluator](https://github.com/Alfresco/alfresco-ng2-components/blob/development/lib/extensions/src/lib/config/rule.extensions.ts)
|
||||
type alias for evaluator functions:
|
||||
|
||||
```ts
|
||||
export type RuleEvaluator = (context: RuleContext, ...args: any[]) => boolean;
|
||||
@@ -23,7 +25,7 @@ export function hasSelection(
|
||||
}
|
||||
```
|
||||
|
||||
The `context` is a reference to a special instance of the [RuleContext](https://github.com/Alfresco/alfresco-content-app/blob/master/src/app/extensions/rule.extensions.ts#L32) type,
|
||||
The `context` is a reference to a special instance of the [RuleContext](https://github.com/Alfresco/alfresco-ng2-components/blob/development/lib/extensions/src/lib/config/rule.extensions.ts) type,
|
||||
that provides each evaluator access to runtime entities.
|
||||
|
||||
```ts
|
||||
@@ -63,7 +65,5 @@ extensions.setEvaluators({
|
||||
Now, the `plugin1.rules.hasSelection` evaluator can be used as an inline rule reference,
|
||||
or part of the composite rule like `core.every`.
|
||||
|
||||
<p class="tip">
|
||||
See the [Registration](/extending/registration) section for more details
|
||||
**Tip:** See the [Registration](/extending/registration) section for more details
|
||||
on how to register your own entries to be re-used at runtime.
|
||||
</p>
|
||||
|
Reference in New Issue
Block a user