Skip to content

Commit 2608fcd

Browse files
committed
Update readme
1 parent cf54750 commit 2608fcd

File tree

5 files changed

+26
-25
lines changed

5 files changed

+26
-25
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,30 @@
33
This widget can be used to time and execute a Microflow as long as a certain form is open. The microflow can be executed once or repeatedly, in which case it will not stop until it returns false or until the form is closed.
44

55
## Contributing
6+
67
For more information on contributing to this repository visit [Contributing to a GitHub repository](https://world.mendix.com/display/howto50/Contributing+to+a+GitHub+repository)!
78

8-
##Typical usage scenario
9+
## Typical usage scenario
910

1011
* Update a grid or object after a certain amount of time, for example a message inbox
1112
* Close a form with a message automatically after 10 seconds
1213
* Automatically make backup copies while the user is still editing an object.
1314
* Open a form and directly trigger validation errors. (to achieve this, use interval: 0, execute once: true, start at once: true) (new in 1.2)
1415

15-
##Features and limitations
16+
## Features and limitations
17+
18+
* Adds timed behavior to your applications.
19+
* Nanoflow support starts from Mendix 7.13.1.
1620

17-
* Adds timed behavior to your applications
21+
## Configuration
1822

19-
##Configuration
2023
* The widget requires a dataview or template grid context. This object will be send as argument to the invoked microflow.
2124

22-
##Properties
23-
24-
* Interval (in ms): Defines how often the microflow is called. Note that the inteval is in milliseconds, so the default, 30000, equals 30 seconds. Note that, unless Execute Once is set to true, the microflow is invoked immediately after loading the form for the first time.
25+
## Properties
26+
27+
* Interval (in ms): Defines how often the microflow or nanoflow is called. Note that the inteval is in milliseconds, so the default, 30000, equals 30 seconds. Note that, unless Execute Once is set to true, the microflow is invoked immediately after loading the form for the first time.
2528
* Execute once: If true, the microflow will be invoked only once, and interval defines after how many seconds.
2629

2730
* Microflow: The microflow to be executed. If the microflow returns false, it will not be executed any longer until the context changes.
28-
* Start at once: If true (and execute once is true), the microflow will be invoked the first time if the widget has loaded. If false, the microflow will be invoked the first time after interval has passed.
31+
* Nanoflow: The nanoflow to be executed. If the nanoflow returns false, it will not be executed any longer until the context changes.
32+
* Start at once: If true (and execute once is true), the microflow or nanoflow will be invoked the first time if the widget has loaded. If false, the microflow or nanoflow will be invoked the first time after interval has passed.

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/MicroflowTimer/MicroflowTimer.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
<property key="interval" type="integer" defaultValue="30000">
99
<caption>Interval (in ms)</caption>
1010
<category>Behavior</category>
11-
<description>Defines how often the microflow is called. Note that the inteval is in milliseconds, so the default, 30000, equals 30 seconds. Note that, unless Execute Once is set to true, the microflow is invoked immediately after loading the form for the first time</description>
11+
<description>Defines how often the microflow or nanoflow is called. Note that the inteval is in milliseconds, so the default, 30000, equals 30 seconds. Note that, unless Execute Once is set to true, the microflow is invoked immediately after loading the form for the first time</description>
1212
</property>
1313
<property key="once" type="boolean" defaultValue="false">
1414
<caption>Execute once</caption>
1515
<category>Behavior</category>
16-
<description>If true, the microflow will be invoked only once, and interval defines after how many seconds</description>
16+
<description>If true, the microflow or nanoflow will be invoked only once, and interval defines after how many seconds</description>
1717
</property>
1818
<property key="startatonce" type="boolean" defaultValue="true">
1919
<caption>Start at once</caption>
2020
<category>Behavior</category>
21-
<description>If true (and execute once is false), the microflow will be invoked the first time if the widget has loaded. If false, the microflow will be invoked the first time after interval has passed</description>
21+
<description>If true (and execute once is false), the microflow or nanoflow will be invoked the first time if the widget has loaded. If false, the microflow or nanoflow will be invoked the first time after interval has passed</description>
2222
</property>
2323
<property key="callEvent" type="enumeration" defaultValue="callMicroflow">
2424
<caption>Call event</caption>
@@ -52,7 +52,7 @@
5252
<property key="intervalAttr" type="attribute" required="false">
5353
<caption>Interval Attribute (in ms)</caption>
5454
<category>Context</category>
55-
<description>Defines how often the microflow is called using an attribute. If set, overrides the interval specified below</description>
55+
<description>Defines how often the microflow or nanoflow is called using an attribute. If set, overrides the interval specified below</description>
5656
<attributeTypes>
5757
<attributeType name="Integer"/>
5858
</attributeTypes>

src/MicroflowTimer/widget/MicroflowTimer.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,12 @@ define([
164164
},
165165

166166
_executeEvent: function() {
167-
if(this.callEvent === "callMicroflow") {
167+
if(this.callEvent === "callMicroflow" && this.microflow) {
168168
this._execMf()
169-
} else {
169+
} else if (this.callEvent === "callNanoflow" && this.nanoflow){
170170
this._executeNanoFlow()
171+
} else {
172+
mx.ui.error("No action specified for " + this.callEvent)
171173
}
172174
},
173175

@@ -208,11 +210,6 @@ define([
208210
},
209211

210212
_executeNanoFlow: function() {
211-
logger.debug(this.id + "._executeNanoFlow");
212-
if (!this._contextObj) {
213-
return;
214-
}
215-
216213
if (this.nanoflow.nanoflow && this.mxcontext) {
217214
mx.data.callNanoflow({
218215
nanoflow: this.nanoflow,

test/widgets/MicroflowTimer.mpk

225 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)