Skip to content

Commit 7c8727f

Browse files
committed
Process pull request feedback
1 parent 726bcdb commit 7c8727f

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/MicroflowTimer/MicroflowTimer.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<widget id="MicroflowTimer.widget.MicroflowTimer" needsEntityContext="true" xmlns="http://www.mendix.com/widget/1.0/">
33
<name>MicroflowTimer</name>
4-
<description>The description of this widget.</description>
4+
<description>The description of this widget</description>
55
<icon></icon>
66

77
<properties>
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 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 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 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>
2222
</property>
2323
<property key="callEvent" type="enumeration" defaultValue="callMicroflow">
2424
<caption>Call event</caption>
@@ -32,35 +32,35 @@
3232
<property key="microflow" type="microflow" required="false">
3333
<caption>Microflow</caption>
3434
<category>Behavior</category>
35-
<description>The microflow to be executed. If the microflow returns false, it will not be executed any longer until the context changes.</description>
35+
<description>The microflow to be executed. If the microflow returns false, it will not be executed any longer until the context changes</description>
3636
<returnType type="Boolean"/>
3737
</property>
3838
<property key="nanoflow" type="nanoflow" required="false">
3939
<caption>Nanoflow</caption>
4040
<category>Behavior</category>
41-
<description>The nanoflow to be executed. If the nanoflow returns false, it will not be executed any longer until the context changes.</description>
41+
<description>The nanoflow to be executed. If the nanoflow returns false, it will not be executed any longer until the context changes</description>
4242
<returnType type="Boolean"/>
4343
</property>
4444
<property key="firstIntervalAttr" type="attribute" required="false">
4545
<caption>First tick delay</caption>
4646
<category>Context</category>
47-
<description>An optional attribute on the context entity, indicating a custom first interval (in milliseconds). This could be used for continuing a timer that ticks once per minute, but should wait for 60 seconds thereafter.</description>
47+
<description>An optional attribute on the context entity, indicating a custom first interval (in milliseconds). This could be used for continuing a timer that ticks once per minute, but should wait for 60 seconds thereafter</description>
4848
<attributeTypes>
4949
<attributeType name="Integer"/>
5050
</attributeTypes>
5151
</property>
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 is called using an attribute. If set, overrides the interval specified below</description>
5656
<attributeTypes>
5757
<attributeType name="Integer"/>
5858
</attributeTypes>
5959
</property>
6060
<property key="timerStatusAttr" type="attribute" required="false">
6161
<caption>Timer Status Attribute</caption>
6262
<category>Context</category>
63-
<description>An optional attribute on the context entity, indicating the status of the timer.</description>
63+
<description>An optional attribute on the context entity, indicating the status of the timer</description>
6464
<attributeTypes>
6565
<attributeType name="Boolean"/>
6666
</attributeTypes>

src/MicroflowTimer/widget/MicroflowTimer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ define([
1212
interval: 30000,
1313
once: false,
1414
startatonce: true,
15-
callEvent: null,
15+
callEvent: "callMicroflow" | "callNanoflow",
1616
microflow: "",
17-
nanoflow: "",
17+
nanoflow: null,
1818
firstIntervalAttr: null,
1919
intervalAttr: null,
2020
timerStatusAttr: null,
@@ -164,7 +164,7 @@ define([
164164
},
165165

166166
_executeEvent: function() {
167-
if(this.callEvent == "callMicroflow") {
167+
if(this.callEvent === "callMicroflow") {
168168
this._execMf()
169169
} else {
170170
this._executeNanoFlow()
@@ -213,7 +213,7 @@ define([
213213
return;
214214
}
215215

216-
if (this.nanoflow.nanoflow) {
216+
if (this.nanoflow.nanoflow && this.mxcontext) {
217217
mx.data.callNanoflow({
218218
nanoflow: this.nanoflow,
219219
origin: this.mxform,
@@ -225,7 +225,7 @@ define([
225225
}
226226
}),
227227
error: lang.hitch(this, function(error) {
228-
logger.error(this.id + ": An error ocurred while executing nanoflow: ", error);
228+
mx.ui.error("An error ocurred while executing nanoflow");
229229
})
230230
});
231231
}

0 commit comments

Comments
 (0)