gbrooks3317
(brooksg@agilenetsystems.com Brooks)
August 18, 2017, 12:48pm
#1
At the moment, the BPM modeller (graphical modeller part) launches into a new BROWSER tab. I can see that you use a Companion to launch this with the following
App.getInstance().getWindowManager()
.showWebPage(url, ParamsMap.of("tryToOpenAsPopup", Boolean.TRUE));
Is there anyway to launch this into a FRAME on an existing window in the application (or indeed as another tab in the application main screen) ? If so, any insights on how to do this would be appreciated
artamonov
(Yuriy Artamonov)
August 21, 2017, 2:45pm
#2
Hi,
At the moment, you can open the same window inside of Embedded UI component. Inherit ProcModelBrowse screen and override _openModeler(ProcModel procModel) method.
public class ExtProcModelBrowse extends ProcModelBrowse {
@Override
protected void _openModeler(ProcModel procModel) {
String modelerUrl = "dispatch" + bpmConfig.getModelerUrl() + "?modelId=" +
procModel.getActModelId() + "&s=" + userSession.getId();
openWindow("bpm-frame-editor", OpenType.NEW_TAB,
ParamsMap.of("modelerUrl", modelerUrl));
}
}
Then create a special host-window for BPM modeler: bpm-frame-editor
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
caption="msg://caption"
class="com.company.demo.web.screens.BpmFrameEditor"
messagesPack="com.company.demo.web.screens">
<dialogMode height="600"
width="800"/>
<layout>
<embedded id="bpmModelerEmbedded"
height="100%"
width="100%"/>
</layout>
</window>
Here we will use Embedded component to show iframe and load BPM modeler to it.
public class BpmFrameEditor extends AbstractWindow {
@Inject
private Embedded bpmModelerEmbedded;
@WindowParam
private String modelerUrl;
@Override
public void init(Map<String, Object> params) {
super.init(params);
bpmModelerEmbedded.setType(Type.BROWSER);
bpmModelerEmbedded.setRelativeSource(modelerUrl);
}
}
Also, it is strongly recommended to use additional application property in web-app.properties:
# Do not unload content of non-active tabs of main tabsheet
cuba.web.mainTabSheetMode = MANAGED
artamonov
(Yuriy Artamonov)
August 21, 2017, 2:47pm
#3
gbrooks3317
(brooksg@agilenetsystems.com Brooks)
August 21, 2017, 7:47pm
#4
Thank you Yuriy, this looks exactly like what I wanted.
system
(system)
August 21, 2017, 7:47pm
#5