Skip to main content

DocuMine Documentation

Binding entity value to component

DocuMine automatically creates a component for each extracted entity, simplifying the process for developers seeking to implement a 1:1 linking between entity and component. In case you see a necessity to implement it, the simplest form of component construction is binding one entity value to a component:

rule "CompletionDate.1.0: Completion Date"
    when
        $completion: Entity(type == "completion_date")
    then
        componentCreationService
        .create(
        "CompletionDate.1.0",
        "Completion Date",
        $completion.getValue(),
        "Completion Date",
        $completion);
    end

The following table provides a detailed breakdown of the rule syntax:

Syntax

Explanation

rule "CompletionDate.1.0: Completion Date"

Name of the rule

Each rule must have a unique name. For further information, please see Rule naming.

$completion: Entity (type == “completion_date”)

Targets entity with the type “Completion Date“.

componentCreationService

Invokes the class responsible for component construction.

.create("CompletionDate.1.0", "Completion Date", $completion.getValue(), "Completion Date", $completion);

Invokes the ‘create’ method to construct a component named “Completion Date”, and binds the value of the “Completion Date” entity to it. That rule applies the “CompletionDate.1.0” identifier.

Notice

For further information about the methods listed in the table, please refer to the relevant sections in the Javadoc documentation:

https://docs.documine.ai/javadoc/index.html

Following the rule execution, you will be able to observe the following outcomes in the component list:

Bind_value_to_component_1_2.png

Result in the component list