Skip to content

Commit dd94ad0

Browse files
author
Jelte Lagendijk
committed
MX7 fix Microflows
1 parent 1f61c62 commit dd94ad0

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "MicroflowTimer",
3-
"version": "3.1.0",
3+
"version": "3.1.1",
44
"description": "",
55
"license": "",
66
"author": "",

src/MicroflowTimer/widget/MicroflowTimer.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,14 @@ define([
163163

164164
_execMf: function() {
165165
logger.debug(this.id + "._execMf");
166+
if (!this._contextObj) {
167+
return;
168+
}
166169

167-
if (this._contextObj && this.microflow !== "") {
168-
169-
var microflowAction = {
170+
if (this.microflow) {
171+
var mfObject = {
170172
params: {
173+
actionname: this.microflow,
171174
applyto: "selection",
172175
guids: [this._contextObj.getGuid()]
173176
},
@@ -177,12 +180,20 @@ define([
177180
this._stopTimer();
178181
}
179182
}),
180-
error: function(error) {
181-
console.warn("Error executing mf: ", error);
182-
}
183+
error: lang.hitch(this, function(error) {
184+
logger.error(this.id + ": An error ocurred while executing microflow: ", error);
185+
})
183186
};
187+
if (!mx.version || mx.version && parseInt(mx.version.split(".")[0]) < 7) {
188+
// < Mendix 7
189+
mfObject.store = {
190+
caller: this.mxform
191+
};
192+
} else {
193+
mfObject.origin = this.mxform;
194+
}
184195

185-
mx.ui.action(this.microflow, microflowAction);
196+
mx.data.action(mfObject, this);
186197
}
187198
},
188199

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="MicroflowTimer" version="3.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="MicroflowTimer" version="3.1.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="MicroflowTimer/MicroflowTimer.xml"/>
66
</widgetFiles>

test/widgets/MicroflowTimer.mpk

120 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)