Skip to content

Commit 60d1562

Browse files
committed
Process pull request review
1 parent ed0f195 commit 60d1562

File tree

7 files changed

+19
-21
lines changed

7 files changed

+19
-21
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ActionTimer [![Support](https://img.shields.io/badge/Mendix%20Support%3A-Platform-green.svg)](https://docs.mendix.com/community/app-store/app-store-content-support)
1+
# Microflow Timer [![Support](https://img.shields.io/badge/Mendix%20Support%3A-Platform-green.svg)](https://docs.mendix.com/community/app-store/app-store-content-support)
22

3-
This widget can be used to time and execute a Microflow as long as a certain form is open. The microflow or nanoflow can be executed once or repeatedly, in which case it will not stop until it returns false or until the form is closed.
3+
This widget can be used to time and execute a Microflow or Nanoflow as long as a certain form is open. The microflow or nanoflow 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
66

@@ -16,11 +16,11 @@ For more information on contributing to this repository visit [Contributing to a
1616
## Features and limitations
1717

1818
* Adds timed behavior to your applications.
19-
* Nanoflow support starts from Mendix 7.13.1.
19+
* Run a Microflow or Nanoflow.
2020

2121
## Configuration
2222

23-
* The widget requires a dataview or template grid context. This object will be send as argument to the invoked microflow.
23+
* The widget requires a dataview or template grid context. This object will be send as argument to the invoked microflow or nanoflow.
2424

2525
## Properties
2626

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "actiontimer",
3-
"version": "3.2.0",
2+
"name": "MicroflowTimer",
3+
"version": "4.0.0",
44
"description": "",
55
"license": "",
66
"author": "",

src/MicroflowTimer/MicroflowTimer.xml

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

@@ -21,7 +21,7 @@
2121
<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">
24-
<caption>Call event</caption>
24+
<caption>Timer event</caption>
2525
<category>Behavior</category>
2626
<description/>
2727
<enumerationValues>

src/MicroflowTimer/widget/MicroflowTimer.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ define([
2626
_timeout: null,
2727
_timerStarted: false,
2828

29-
postcreate: function() {
29+
postCreate: function() {
3030
this._handles = [];
31+
32+
if(!(this.microflow && this.callEvent == "callMicroflow" || this.nanoflow.nanoflow && this.callEvent == "callNanoflow")) {
33+
mx.ui.error("No action specified for " + this.callEvent)
34+
}
3135
},
3236

3337
update: function (obj, callback) {
@@ -166,10 +170,10 @@ define([
166170
_executeEvent: function() {
167171
if(this.callEvent === "callMicroflow" && this.microflow) {
168172
this._execMf()
169-
} else if (this.callEvent === "callNanoflow" && this.nanoflow){
173+
} else if (this.callEvent === "callNanoflow" && this.nanoflow.nanoflow){
170174
this._executeNanoFlow()
171175
} else {
172-
mx.ui.error("No action specified for " + this.callEvent)
176+
return;
173177
}
174178
},
175179

@@ -183,6 +187,7 @@ define([
183187
var mfObject = {
184188
params: {
185189
actionname: this.microflow,
190+
origin: this.mxform,
186191
applyto: "selection",
187192
guids: [this._contextObj.getGuid()]
188193
},
@@ -193,18 +198,10 @@ define([
193198
}
194199
}),
195200
error: lang.hitch(this, function(error) {
201+
logger.error(this.id + ": An error ocurred while executing microflow: ", error);
196202
mx.ui.error("An error ocurred while executing microflow" + error.message);
197203
})
198204
};
199-
if (!mx.version || mx.version && parseInt(mx.version.split(".")[0]) < 7) {
200-
// < Mendix 7
201-
mfObject.store = {
202-
caller: this.mxform
203-
};
204-
} else {
205-
mfObject.origin = this.mxform;
206-
}
207-
208205
mx.data.action(mfObject, this);
209206
}
210207
},
@@ -222,6 +219,7 @@ define([
222219
}
223220
}),
224221
error: lang.hitch(this, function(error) {
222+
logger.error(this.id + ": An error ocurred while executing nanoflow: ", error);
225223
mx.ui.error("An error ocurred while executing nanoflow" + error.message);
226224
})
227225
});

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="ActionTimer" version="3.2.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="MicroflowTimer" version="4.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="MicroflowTimer/MicroflowTimer.xml"/>
66
</widgetFiles>

test/widgets/MicroflowTimer.mpk

10 Bytes
Binary file not shown.

test/widgets/actiontimer.mpk

-3.74 KB
Binary file not shown.

0 commit comments

Comments
 (0)