-
Notifications
You must be signed in to change notification settings - Fork 761
Return value mapping documentation #10376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alihcsumer
wants to merge
7
commits into
mendix:development
Choose a base branch
from
alihcsumer:wtf/actionreturnvalues
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+77
−0
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d8c11e0
Add return value mapping document
alihcsumer 1717157
Review: Update expression mapping screen shot
alihcsumer 6a61113
Review: Reorganize the structure
alihcsumer 7c316d7
Merge branch 'development' into pr/alihcsumer/10376
Yiyun333 8d06980
Screenshots review
Yiyun333 bd2466e
Added SP version information
Yiyun333 4663b17
Review
Yiyun333 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...ide/modeling/application-logic/microflows-and-nanoflows/return-value-mapping.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| --- | ||
| title: "Return Value Mapping" | ||
| url: /refguide/return-value-mapping/ | ||
| weight: 60 | ||
| #If moving or renaming this doc file, implement a temporary redirect and let the respective team know they should update the URL in the product. See Mapping to Products for more details. | ||
| --- | ||
|
|
||
| ## Introduction | ||
|
|
||
| Pages and snippets can use [return values](/refguide/end-event/#return-value) when calling microflows or nanoflows by specifying a return value mapping. This feature enhances microflow and nanoflow reusability by allowing pages to update local values based on flow return values without needing to pass objects containing those attributes to the flow. | ||
Yiyun333 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Yiyun333 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Return values can be mapped to available variables on the page or snippet. Both primitive and object return value types are supported. Using an expression, the return value can be transformed as needed before assignment. | ||
|
|
||
| {{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/return-value-mapping-list.png" width="500px" class="no-border" >}} | ||
Yiyun333 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Primitive Return Values | ||
|
|
||
| For primitive return values (such as strings, booleans, integers, decimals, or enumerations), the value can be assigned to any matching attribute of available objects on the page, or to variables and parameters of pages or snippets. The target must have a compatible data type with the return value. | ||
|
|
||
| ## Object Return Values | ||
|
|
||
| When a microflow or nanoflow returns an object, you can specify a return value mapping using one or more attributes of that object. This capability makes it possible to dynamically update multiple attributes, variables, and parameters with the return value of a single flow. | ||
|
|
||
| To use multiple attributes from a returned object, add more than one return value mapping to the same flow call. This is particularly useful when assigning multiple computed values to different variables from the same return value. | ||
|
|
||
| ## Mapping Return Values from a Page | ||
|
|
||
| When calling a microflow or nanoflow action, you can map return values in two primary ways. | ||
|
|
||
| ### Variable Return Value Mappings | ||
|
|
||
| Variable return value mappings are used to map values returned by the microflow or nanoflow directly. When the flow returns an object, you can select specific attributes from that object to assign to variables on the page or snippet. | ||
|
|
||
| {{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/variable-return-value-mapping.png" width="500px" class="no-border" >}} | ||
|
|
||
| ### Expression-Based Return Value Mappings | ||
|
|
||
| Both primitive values and object attributes can be mapped using expressions. This method allows you to use functions within the expression to modify the return value before it is assigned. | ||
|
|
||
| {{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/expression-return-value-mapping.png" width="500px" class="no-border" >}} | ||
Binary file added
BIN
+49.3 KB
...croflows-and-nanoflows/return-value-mapping/expression-return-value-mapping.png
Yiyun333 marked this conversation as resolved.
Show resolved
Hide resolved
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.6 KB
...gic/microflows-and-nanoflows/return-value-mapping/return-value-mapping-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28 KB
...microflows-and-nanoflows/return-value-mapping/variable-return-value-mapping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.