Skip to content

Commit 599833f

Browse files
committed
update
1 parent 949ddc4 commit 599833f

File tree

1 file changed

+126
-89
lines changed

1 file changed

+126
-89
lines changed

all_handbook_content.txt

Lines changed: 126 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,37 +2895,23 @@ Alternatively, it is also possible to install them manually (advanced):
28952895
### Dataset import endpoints
28962896

28972897
<WebhookEndpoints
2898-
eu1="https://elis.rossum.ai/svc/scheduled-imports/api/file_storage/v1/dataset_import"
2899-
eu2="https://shared-eu2.rossum.app/svc/scheduled-imports/api/file_storage/v1/dataset_import"
2900-
us="https://shared-us2.rossum.app/svc/scheduled-imports/api/file_storage/v1/dataset_import"
2901-
jp="https://shared-jp.rossum.app/svc/scheduled-imports/api/file_storage/v1/dataset_import"
2898+
eu1="https://elis.task-manager.rossum-ext.app/api/v1/tasks/file-storage-dataset-import"
2899+
eu2="https://shared-eu2.task-manager.rossum-ext.app/api/v1/tasks/file-storage-dataset-import"
2900+
us="https://shared-us2.task-manager.rossum-ext.app/api/v1/tasks/file-storage-dataset-import"
2901+
jp="https://shared-jp.task-manager.rossum-ext.app/api/v1/tasks/file-storage-dataset-import"
29022902
/>
29032903

2904-
TODO: new endpoints (verify it aligns with the store version):
2905-
2906-
EU1 Ireland https://elis.task-manager.rossum-ext.app/api/v1/tasks/file-storage-dataset-import
2907-
EU2 Frankfurt https://shared-eu2.task-manager.rossum-ext.app/api/v1/tasks/file-storage-dataset-import
2908-
US east coast https://shared-us2.task-manager.rossum-ext.app/api/v1/tasks/file-storage-dataset-import
2909-
Japan Tokyo https://shared-jp.task-manager.rossum-ext.app/api/v1/tasks/file-storage-dataset-import
2910-
29112904
<RossumInternalOnly url="https://rossumai.atlassian.net/l/cp/PV1jzmqK" />
29122905

29132906
### Document import endpoints
29142907

29152908
<WebhookEndpoints
2916-
eu1="https://elis.rossum.ai/svc/scheduled-imports/api/file_storage/v1/document_import"
2917-
eu2="https://shared-eu2.rossum.app/svc/scheduled-imports/api/file_storage/v1/document_import"
2918-
us="https://shared-us2.rossum.app/svc/scheduled-imports/api/file_storage/v1/document_import"
2919-
jp="https://shared-jp.rossum.app/svc/scheduled-imports/api/file_storage/v1/document_import"
2909+
eu1="https://elis.task-manager.rossum-ext.app/api/v1/tasks/file-storage-document-import"
2910+
eu2="https://shared-eu2.task-manager.rossum-ext.app/api/v1/tasks/file-storage-document-import"
2911+
us="https://shared-us2.task-manager.rossum-ext.app/api/v1/tasks/file-storage-document-import"
2912+
jp="https://shared-jp.task-manager.rossum-ext.app/api/v1/tasks/file-storage-document-import"
29202913
/>
29212914

2922-
TODO: new endpoints (verify it aligns with the store version):
2923-
2924-
EU1 Ireland https://elis.task-manager.rossum-ext.app/api/v1/tasks/file-storage-document-import
2925-
EU2 Frankfurt https://shared-eu2.task-manager.rossum-ext.app/api/v1/tasks/file-storage-document-import
2926-
US east coast https://shared-us2.task-manager.rossum-ext.app/api/v1/tasks/file-storage-document-import
2927-
Japan Tokyo https://shared-jp.task-manager.rossum-ext.app/api/v1/tasks/file-storage-document-import
2928-
29292915
<RossumInternalOnly url="https://rossumai.atlassian.net/l/cp/PV1jzmqK" />
29302916

29312917
### Export endpoints
@@ -5617,6 +5603,9 @@ title: 'Rossum Formulas'
56175603
sidebar_position: 1
56185604
---
56195605

5606+
import Tabs from '@theme/Tabs';
5607+
import TabItem from '@theme/TabItem';
5608+
56205609
This section covers both the Rossum **Formula Fields** and the **Serverless Functions** (Formula Fields flavor in custom extensions).
56215610

56225611
## Installation
@@ -5690,92 +5679,112 @@ def rossum_hook_request_handler(payload):
56905679

56915680
Formula field examples do not require any further modification.
56925681

5693-
### Get datapoint value
5682+
### Working with datapoints
56945683

5695-
#### Formula field
5684+
<Tabs groupId="rossum-formulas-flavor">
5685+
<TabItem value="formula_field" label="Formula field" default>
56965686

5697-
Can be either returned directly from the formula fields or stored in some temporary variable.
5687+
Getting values (or meta information):
56985688

56995689
```py
5700-
field.amount
5690+
field.amount # Get datapoint value
5691+
field.amount.id # Get datapoint system ID
5692+
field.amount.attr.rir_confidence # Get confidence score
5693+
field.amount.attr.ocr_raw_text # Get raw value extracted by OCR, if applicable
5694+
field.amount.attr.rir_raw_text # Get raw extracted text by RIR
57015695
```
57025696

5703-
#### Serverless function
5697+
:::warning
57045698

5705-
In case of serverless function, the value can never be returned directly and must be either used in some other function call, or stored in some temporary variable to be used later:
5699+
Formula fields cannot write into any other fields. They simply return the value into the formula field itself.
57065700

5707-
```py
5708-
tmp = t.field.amount
5709-
```
5701+
:::
57105702

5711-
### Get datapoint metadata
5703+
</TabItem>
5704+
<TabItem value="serverless_function" label="Serverless function">
57125705

5713-
#### Formula field
5706+
Getting values (or meta information):
57145707

57155708
```py
5716-
field.amount.id # Datapoint system ID
5717-
field.amount.attr.rir_confidence # Confidence score
5718-
field.amount.attr.ocr_raw_text # Raw value extracted by OCR, if applicable
5719-
field.amount.attr.rir_raw_text # Raw extracted text by RIR
5709+
t.field.amount # Get datapoint value
5710+
t.field.amount.id # Get datapoint system ID
5711+
t.field.amount.rir_confidence # Get confidence score
5712+
t.field.amount.attr.ocr_raw_text # Get raw value extracted by OCR, if applicable
5713+
t.field.amount.attr.rir_raw_text # Get raw extracted text by RIR
57205714
```
57215715

5722-
#### Serverless function
5716+
Writing values:
57235717

57245718
```py
5725-
t.field.amount.id
5726-
t.field.amount.rir_confidence
5727-
5728-
t.field.amount.attr.ocr_raw_text
5729-
t.field.amount.attr.rir_raw_text
5719+
t.field.amount = 10
57305720
```
57315721

5732-
### Write into datapoint value
5733-
5734-
#### Formula field
5722+
</TabItem>
5723+
</Tabs>
57355724

5736-
:::warning
5725+
### Working with annotation data
57375726

5738-
Formula fields cannot write into any other fields. They simply return the value into the formula field itself.
5727+
<Tabs groupId="rossum-formulas-flavor">
5728+
<TabItem value="formula_field" label="Formula field" default>
57395729

5740-
:::
5730+
```py
5731+
annotation.id # Get annotation ID
5732+
annotation.metadata # Get annotation metadata
5733+
annotation.document.original_file_name # Get document original file name
5734+
annotation.email.subject # Get email subject
5735+
```
57415736

5742-
#### Serverless function
5737+
</TabItem>
5738+
<TabItem value="serverless_function" label="Serverless function">
57435739

57445740
```py
5745-
t.field.amount = 10
5741+
t.annotation.id # Get annotation ID
5742+
t.annotation.metadata # Get annotation metadata
5743+
t.annotation.document.original_file_name # Get document original file name
5744+
t.annotation.email.subject # Get email subject
57465745
```
57475746

5747+
</TabItem>
5748+
</Tabs>
5749+
57485750
### Check whether datapoint is set or not
57495751

5750-
#### Formula field
5752+
<Tabs groupId="rossum-formulas-flavor">
5753+
<TabItem value="formula_field" label="Formula field" default>
57515754

57525755
```py
5753-
is_set(field.amount) # Returns `true` if datapoint is set (has value)
5754-
is_empty(field.amount) # Opposite of `is_set`
5756+
is_set(field.amount) # Returns `true` if datapoint is set (has value)
5757+
is_empty(field.amount) # Opposite of `is_set`
57555758
```
57565759

5757-
#### Serverless function
5760+
</TabItem>
5761+
<TabItem value="serverless_function" label="Serverless function">
57585762

57595763
```py
57605764
from txscript import TxScript, is_set, is_empty
57615765

57625766
# …
57635767

5764-
is_set(t.field.amount)
5765-
is_empty(t.field.amount)
5768+
is_set(t.field.amount) # Returns `true` if datapoint is set (has value)
5769+
is_empty(t.field.amount) # Opposite of `is_set`
57665770
```
57675771

5772+
</TabItem>
5773+
</Tabs>
5774+
57685775
### Defaulting values
57695776

57705777
Use the default value if the field is empty.
57715778

5772-
#### Formula field
5779+
<Tabs groupId="rossum-formulas-flavor">
5780+
<TabItem value="formula_field" label="Formula field" default>
57735781

57745782
```py
57755783
default_to(field.amount, 0)
57765784
```
57775785

5778-
#### Serverless function
5786+
</TabItem>
5787+
<TabItem value="serverless_function" label="Serverless function">
57795788

57805789
```py
57815790
from txscript import TxScript, default_to
@@ -5785,11 +5794,15 @@ from txscript import TxScript, default_to
57855794
default_to(t.field.amount, 0)
57865795
```
57875796

5797+
</TabItem>
5798+
</Tabs>
5799+
57885800
### Substitute
57895801

57905802
Substitute is an alias for [`re.sub`](https://docs.python.org/3/library/re.html#re.sub) function (for convenience).
57915803

5792-
#### Formula field
5804+
<Tabs groupId="rossum-formulas-flavor">
5805+
<TabItem value="formula_field" label="Formula field" default>
57935806

57945807
```py
57955808
substitute(r"[^0-9]", r"", field.document_id) # Remove non-digit characters
@@ -5801,7 +5814,8 @@ Could also be written as (`re` is imported automatically):
58015814
re.sub(r"[^0-9]", r"", field.document_id)
58025815
```
58035816

5804-
#### Serverless function
5817+
</TabItem>
5818+
<TabItem value="serverless_function" label="Serverless function">
58055819

58065820
```py
58075821
from txscript import TxScript, substitute
@@ -5811,40 +5825,48 @@ from txscript import TxScript, substitute
58115825
substitute(r"[^0-9]", r"", t.field.document_id)
58125826
```
58135827

5828+
</TabItem>
5829+
</Tabs>
5830+
58145831
### Show info/warning/error messages
58155832

5816-
#### Formula field
5833+
:::note
58175834

5818-
```py
5819-
show_info("…") # Show global info message
5820-
show_info("…", field.amount) # Show info message on the specified field
5835+
Messages do not affect the automation behavior and, therefore, automation blockers must be set explicitly (see how to set [automation blockers](#set-automation-blockers)). The only exception is `show_error` which always blocks the automation.
58215836

5822-
show_warning("…") # Show global warning message
5823-
show_warning("…", field.amount) # Show warning message on the specified field
5837+
:::
58245838

5825-
show_error("…") # Show global error message
5826-
show_error("…", field.amount) # Show error message on the specified field
5827-
```
5839+
<Tabs groupId="rossum-formulas-flavor">
5840+
<TabItem value="formula_field" label="Formula field" default>
58285841

5829-
#### Serverless function
5842+
```py
5843+
show_info("…") # Show global info message
5844+
show_info("…", field.amount) # Show info message on the specified field
58305845

5831-
:::note
5846+
show_warning("…") # Show global warning message
5847+
show_warning("…", field.amount) # Show warning message on the specified field
58325848

5833-
Messages do not affect the automation behavior and, therefore, automation blockers must be set explicitly (see how to set [automation blockers](#set-automation-blockers)). The only exception is `show_error` which always blocks the automation.
5849+
show_error("…") # Show global error message
5850+
show_error("…", field.amount) # Show error message on the specified field
5851+
```
58345852

5835-
:::
5853+
</TabItem>
5854+
<TabItem value="serverless_function" label="Serverless function">
58365855

58375856
```py
5838-
t.show_info("…")
5839-
t.show_info("…", t.field.amount)
5857+
t.show_info("…") # Show global info message
5858+
t.show_info("…", t.field.amount) # Show info message on the specified field
58405859

5841-
t.show_warning("…")
5842-
t.show_warning("…", t.field.amount)
5860+
t.show_warning("…") # Show global warning message
5861+
t.show_warning("…", t.field.amount) # Show warning message on the specified field
58435862

5844-
t.show_error("…")
5845-
t.show_error("…", t.field.amount)
5863+
t.show_error("…") # Show global error message
5864+
t.show_error("…", t.field.amount) # Show error message on the specified field
58465865
```
58475866

5867+
</TabItem>
5868+
</Tabs>
5869+
58485870
### Set automation blockers
58495871

58505872
:::note
@@ -5853,50 +5875,65 @@ Automation blockers must be set independently of the info/warning messages. Erro
58535875

58545876
:::
58555877

5856-
#### Formula field
5878+
<Tabs groupId="rossum-formulas-flavor">
5879+
<TabItem value="formula_field" label="Formula field" default>
58575880

58585881
```py
58595882
automation_blocker("message", field.amount)
58605883
```
58615884

5862-
#### Serverless function
5885+
</TabItem>
5886+
<TabItem value="serverless_function" label="Serverless function">
58635887

58645888
```py
58655889
t.automation_blocker("message", t.field.amount)
58665890
```
58675891

5892+
</TabItem>
5893+
</Tabs>
5894+
58685895
### Create multivalue field values
58695896

5870-
#### Formula field
5897+
<Tabs groupId="rossum-formulas-flavor">
5898+
<TabItem value="formula_field" label="Formula field" default>
58715899

58725900
:::warning
58735901

5874-
Multivalue formula fields are currently not supported.
5902+
Multivalue formula fields are currently not supported (only serverless functions).
58755903

58765904
:::
58775905

5878-
#### Serverless function
5906+
</TabItem>
5907+
<TabItem value="serverless_function" label="Serverless function">
58795908

58805909
```py
58815910
t.field.multivalue_field.all_values = ["AAA", "BBB"]
58825911
```
58835912

5913+
</TabItem>
5914+
</Tabs>
5915+
58845916
### Create enum field options
58855917

5886-
#### Formula field
5918+
<Tabs groupId="rossum-formulas-flavor">
5919+
<TabItem value="formula_field" label="Formula field" default>
58875920

58885921
:::warning
58895922

5890-
Changing enum field options is currently not supported in formula fields.
5923+
Changing enum field options is currently not supported in formula fields (only serverless functions).
58915924

58925925
:::
58935926

5894-
#### Serverless function
5927+
</TabItem>
5928+
<TabItem value="serverless_function" label="Serverless function">
58955929

58965930
```py
58975931
t.field.enum_field.attr.options = [{"label":"AAA", "value":"aaa"}, {"label":"BBB", "value":"bbb"}]
58985932
t.field.enum_field = "bbb"
58995933
```
5934+
5935+
</TabItem>
5936+
</Tabs>
59005937
:::warning[Work in progress]
59015938

59025939
We're still working on this part and would love to hear your thoughts! Feel free to [share your feedback](https://github.com/rossumai/university/discussions) or [submit a pull request](https://github.com/rossumai/university/pulls). Thank you! 🙏
@@ -14360,5 +14397,5 @@ answers={[
1436014397
{ text: 'Yes, MDH can return values into any preconfigured field' },
1436114398
{ text: 'No, only enum fields are supported', isCorrect: true }
1436214399
]}>
14363-
The only field type that Master Data Hub (MDH) extension supports are `enum` fields. Enum fields limit the section to only one specific value. However, we can still access all the values (options) using the `x.field.order_id_match.attr.options` code which can later be distributed into a multivalue table.
14400+
The only field type that Master Data Hub (MDH) extension supports are `enum` fields. Enum fields limit the section to only one specific value. However, we can still access all the values (options) using the `x.field.order_id_match.attr.options` code which can later be distributed into a multivalue table.
1436414401
</QuizComponent>

0 commit comments

Comments
 (0)