提交 41d760d4 编写于 作者: J Joram Barrez

Merge branch 'master' of github.com:Activiti/Activiti

Conflicts:
	modules/activiti-explorer/src/main/java/org/activiti/explorer/Messages.java
......@@ -44,6 +44,7 @@ import org.activiti.explorer.ui.process.simple.editor.SimpleTableEditor;
import org.activiti.explorer.ui.profile.ProfilePopupWindow;
import org.activiti.explorer.ui.reports.ReportsMenuBar;
import org.activiti.explorer.ui.reports.RunReportsPage;
import org.activiti.explorer.ui.reports.SavedReportsPage;
import org.activiti.explorer.ui.task.ArchivedPage;
import org.activiti.explorer.ui.task.InboxPage;
import org.activiti.explorer.ui.task.InvolvedPage;
......@@ -238,6 +239,15 @@ public class DefaultViewManager implements ViewManager, Serializable {
public void showRunReportPage() {
switchView(new RunReportsPage(), ViewManager.MAIN_NAVIGATION_REPORT, ReportsMenuBar.ENTRY_RUN_REPORTS);
}
public void showSavedReportPage() {
switchView(new SavedReportsPage(), ViewManager.MAIN_NAVIGATION_REPORT, ReportsMenuBar.ENTRY_SAVED_REPORTS);
}
@Override
public void showSavedReportPage(String modelId) {
switchView(new SavedReportsPage(modelId), ViewManager.MAIN_NAVIGATION_REPORT, ReportsMenuBar.ENTRY_SAVED_REPORTS);
}
// Management
......
......@@ -289,6 +289,8 @@ public interface Messages {
String REPORTING_SAVE_POPUP_NAME_EMPTY = "reporting.save.popup.name.empty";
String REPORTING_SAVE_POPUP_NAME_EXISTS = "reporting.save.popup.name.exists";
String REPORTING_SAVE_POPUP_NAME_TOO_LONG = "reporting.save.popup.name.too.long";
String REPORTING_SAVE_POPUP_NAME_TOO_LONG = "reporting.save.popup..name.too.long";
String REPORTING_CREATE_TIME = "reporting.report.created";
// Management menu
String MGMT_MENU_DATABASE = "management.menu.database";
......
......@@ -89,6 +89,10 @@ public interface ViewManager {
void showRunReportPage();
void showSavedReportPage();
void showSavedReportPage(String modelId);
// Management
void showDatabasePage();
......@@ -130,5 +134,5 @@ public interface ViewManager {
// Profile
void showProfilePopup(String userId);
}
......@@ -68,6 +68,7 @@ public class NavigatorManager implements InitializingBean, Serializable {
addNavigator(new GroupNavigator());
addNavigator(new AdministrationNavigator());
addNavigator(new MyProcessesNavigator());
addNavigator(new SavedReportNavigator());
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.explorer.navigation;
import org.activiti.explorer.ExplorerApp;
/**
* @author Frederik Heremans
*/
public class SavedReportNavigator implements Navigator {
private static final long serialVersionUID = 1L;
public static final String SAVED_REPORT_URI_PART = "savedReport";
public String getTrigger() {
return SAVED_REPORT_URI_PART;
}
public void handleNavigation(UriFragment uriFragment) {
String modelId = uriFragment.getUriPart(1);
if(modelId != null) {
ExplorerApp.get().getViewManager().showSavedReportPage(modelId);
} else {
ExplorerApp.get().getViewManager().showSavedReportPage();
}
}
}
......@@ -93,5 +93,6 @@ public class Images {
// Reports
public static final Resource REPORT_50 = new ThemeResource("img/report-50.png");
public static final Resource REPORT_22 = new ThemeResource("img/report-22.png");
}
......@@ -56,7 +56,7 @@ public class ReportsMenuBar extends ToolBar {
protected void addSavedReportsToolbarEntry() {
addToolbarEntry(ENTRY_SAVED_REPORTS, i18nManager.getMessage(Messages.REPORTING_MENU_SAVED_REPORTS), new ToolbarCommand() {
public void toolBarItemSelected() {
viewManager.showRunReportPage();
viewManager.showSavedReportPage();
}
});
}
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.explorer.ui.reports;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricVariableInstance;
import org.activiti.explorer.ExplorerApp;
import org.activiti.explorer.I18nManager;
import org.activiti.explorer.Messages;
import org.activiti.explorer.ui.Images;
import org.activiti.explorer.ui.custom.DetailPanel;
import org.activiti.explorer.ui.form.FormPropertiesForm;
import org.activiti.explorer.ui.mainlayout.ExplorerLayout;
import org.activiti.explorer.util.time.HumanTime;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Reindeer;
/**
* @author Frederik Heremans
*/
public class SavedReportDetailPanel extends DetailPanel {
private static final long serialVersionUID = 1L;
protected HistoricProcessInstance historicProcessInstance;
protected I18nManager i18nManager;
protected VerticalLayout detailPanelLayout;
protected HorizontalLayout detailContainer;
protected FormPropertiesForm processDefinitionStartForm;
public SavedReportDetailPanel(String historicProcessInstance) {
this.i18nManager = ExplorerApp.get().getI18nManager();
this.historicProcessInstance = ProcessEngines.getDefaultProcessEngine()
.getHistoryService().createHistoricProcessInstanceQuery().processInstanceId(historicProcessInstance).singleResult();
initUi();
}
protected void initUi() {
setSizeFull();
addStyleName(Reindeer.LAYOUT_WHITE);
detailPanelLayout = new VerticalLayout();
detailPanelLayout.setWidth(100, UNITS_PERCENTAGE);
detailPanelLayout.setMargin(true);
setDetailContainer(detailPanelLayout);
initHeader();
detailContainer = new HorizontalLayout();
detailContainer.addStyleName(Reindeer.PANEL_LIGHT);
detailPanelLayout.addComponent(detailContainer);
detailContainer.setSizeFull();
initForm();
}
protected void initHeader() {
GridLayout details = new GridLayout(2, 2);
details.setWidth(100, UNITS_PERCENTAGE);
details.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
details.setSpacing(true);
details.setMargin(false, false, true, false);
details.setColumnExpandRatio(1, 1.0f);
detailPanelLayout.addComponent(details);
// Image
Embedded image = new Embedded(null, Images.REPORT_50);
details.addComponent(image, 0, 0, 0, 1);
// Name
Label nameLabel = new Label(SavedReportListItem.getReportDisplayName(historicProcessInstance));
nameLabel.addStyleName(Reindeer.LABEL_H2);
details.addComponent(nameLabel, 1, 0);
// Properties
HorizontalLayout propertiesLayout = new HorizontalLayout();
propertiesLayout.setSpacing(true);
details.addComponent(propertiesLayout);
// Created Time
String createLabel = i18nManager.getMessage(Messages.REPORTING_CREATE_TIME, new HumanTime(i18nManager).format(historicProcessInstance.getEndTime()));
Label versionLabel = new Label(createLabel);
versionLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_START_TIME);
propertiesLayout.addComponent(versionLabel);
}
protected void initForm() {
// Report dataset is stored as historical variable as json
HistoricVariableInstance historicVariableInstance = ProcessEngines.getDefaultProcessEngine().getHistoryService()
.createHistoricVariableInstanceQuery()
.processInstanceId(historicProcessInstance.getId())
.variableName("reportData")
.singleResult();
// Generate chart
byte[] reportData = (byte[]) historicVariableInstance.getValue();
ChartComponent chart = ChartGenerator.generateChart(reportData);
chart.setWidth(100, UNITS_PERCENTAGE);
chart.setHeight(100, UNITS_PERCENTAGE);
// Put chart on screen
detailContainer.addComponent(chart);
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.explorer.ui.reports;
import java.text.DateFormat;
import java.util.Date;
import org.activiti.engine.ActivitiIllegalArgumentException;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.impl.identity.Authentication;
import com.vaadin.data.Property;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.data.util.PropertysetItem;
/**
* @author Frederik Heremans
*/
public class SavedReportListItem extends PropertysetItem implements Comparable<SavedReportListItem> {
private static final long serialVersionUID = 1L;
public SavedReportListItem(HistoricProcessInstance historicProcessInstance) {
addItemProperty("id", new ObjectProperty<String>(historicProcessInstance.getId(), String.class));
addItemProperty("name", getNameProperty(historicProcessInstance));
if(historicProcessInstance.getEndTime() == null) {
throw new ActivitiIllegalArgumentException("The given process-instance is not ended yet");
}
addItemProperty("createTime", new ObjectProperty<Date>(historicProcessInstance.getEndTime(), Date.class));
}
public int compareTo(SavedReportListItem other) {
Date createTime = (Date) getItemProperty("createTime").getValue();
Date otherCreateTime = (Date) other.getItemProperty("createTime").getValue();
return createTime.compareTo(otherCreateTime);
}
protected Property getNameProperty(HistoricProcessInstance historicProcessInstance) {
return new ObjectProperty<String>(getReportDisplayName(historicProcessInstance), String.class);
}
public static String getReportDisplayName(HistoricProcessInstance historicProcessInstance) {
if(historicProcessInstance.getBusinessKey() != null && !historicProcessInstance.getBusinessKey().isEmpty()) {
if(Authentication.getAuthenticatedUserId() != null) {
return historicProcessInstance.getBusinessKey().replaceFirst(Authentication.getAuthenticatedUserId() + "\\_", "");
} else {
return historicProcessInstance.getBusinessKey();
}
} else {
return DateFormat.getDateTimeInstance().format(historicProcessInstance.getEndTime());
}
}
}
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.explorer.ui.reports;
import java.util.ArrayList;
import java.util.List;
import org.activiti.engine.HistoryService;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricProcessInstanceQuery;
import org.activiti.explorer.data.AbstractLazyLoadingQuery;
import com.vaadin.data.Item;
/**
* @author Frederik Heremans
*/
public class SavedReportsListQuery extends AbstractLazyLoadingQuery {
private static final long serialVersionUID = -7865037930384885968L;
protected transient HistoryService historyService;
public SavedReportsListQuery() {
this.historyService = ProcessEngines.getDefaultProcessEngine().getHistoryService();
}
public int size() {
return (int) createQuery().count();
}
public List<Item> loadItems(int start, int count) {
List<HistoricProcessInstance> processInstances = createQuery().listPage(start, count);
List<Item> reportItems = new ArrayList<Item>();
for (HistoricProcessInstance instance : processInstances) {
reportItems.add(new SavedReportListItem(instance));
}
return reportItems;
}
protected HistoricProcessInstanceQuery createQuery() {
// TODO: Add additional "processDefinitionCategory" on HistoricProcessInstanceQuery instead of
// using variables to find all completed reports. This is more robust and performant
return historyService.createHistoricProcessInstanceQuery()
.finished()
.variableValueNotEquals("reportData", null);
}
public Item loadSingleResult(String id) {
return new SavedReportListItem(historyService.createHistoricProcessInstanceQuery().processInstanceId(id).singleResult());
}
public void setSorting(Object[] propertyIds, boolean[] ascending) {
throw new UnsupportedOperationException();
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.explorer.ui.reports;
import org.activiti.explorer.ExplorerApp;
import org.activiti.explorer.data.LazyLoadingContainer;
import org.activiti.explorer.data.LazyLoadingQuery;
import org.activiti.explorer.navigation.SavedReportNavigator;
import org.activiti.explorer.navigation.UriFragment;
import org.activiti.explorer.ui.AbstractTablePage;
import org.activiti.explorer.ui.Images;
import org.activiti.explorer.ui.custom.ToolBar;
import org.activiti.explorer.ui.util.ThemeImageColumnGenerator;
import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.Table;
/**
* @author Frederik Heremans
*/
public class SavedReportsPage extends AbstractTablePage {
private static final long serialVersionUID = -5259331126409002997L;
protected String reportId;
protected Table reportTable;
protected LazyLoadingQuery reportListQuery;
protected LazyLoadingContainer reportListContainer;
public SavedReportsPage(String reportId) {
this.reportId = reportId;
}
public SavedReportsPage() {
this(null);
}
protected Table createList() {
reportTable = new Table();
reportListQuery = new SavedReportsListQuery();
reportListContainer = new LazyLoadingContainer(reportListQuery);
reportTable.setContainerDataSource(reportListContainer);
// Column headers
reportTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.REPORT_22));
reportTable.setColumnWidth("icon", 22);
reportTable.addContainerProperty("name", String.class, null);
reportTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
// Listener to change right panel when clicked on a report
reportTable.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 1L;
public void valueChange(ValueChangeEvent event) {
Item item = reportTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
if (item != null) {
String historicProcessInstanceId = (String) item.getItemProperty("id").getValue();
setDetailComponent(new SavedReportDetailPanel(historicProcessInstanceId));
// Update URL
ExplorerApp.get().setCurrentUriFragment(
new UriFragment(SavedReportNavigator.SAVED_REPORT_URI_PART, historicProcessInstanceId));
} else {
// Nothing selected
setDetailComponent(null);
ExplorerApp.get().setCurrentUriFragment(new UriFragment(SavedReportNavigator.SAVED_REPORT_URI_PART));
}
}
});
return reportTable;
}
protected ToolBar createMenuBar() {
return new ReportsMenuBar();
}
@Override
protected void initUi() {
super.initUi();
if(reportId != null) {
selectElement(reportListContainer.getIndexForObjectId(reportId));
} else {
selectElement(0);
}
}
}
......@@ -270,6 +270,7 @@ reporting.save.popup.name = Name
reporting.save.popup.name.exists = Invalid name: a report with this name already exists
reporting.save.popup.name.too.long = Invalid name: name is too long
reporting.save.popup.name.empty = Name must be provided
reporting.report.created = Created: {0}
# Management menu
management.menu.database = Database
......
......@@ -11,7 +11,7 @@ var ActivitiRest = {
success: function(data, textStatus) {
var processDefinition = data;
if (!processDefinition) {
console.error("Process definition '" + processDefinitionKey + "' not found");
//console.error("Process definition '" + processDefinitionKey + "' not found");
} else {
callback.apply({processDefinitionId: processDefinition.id});
}
......@@ -34,7 +34,7 @@ var ActivitiRest = {
success: function(data, textStatus) {
var processDefinitionDiagramLayout = data;
if (!processDefinitionDiagramLayout) {
console.error("Process definition diagram layout '" + processDefinitionId + "' not found");
//console.error("Process definition diagram layout '" + processDefinitionId + "' not found");
return;
} else {
callback.apply({processDefinitionDiagramLayout: processDefinitionDiagramLayout});
......@@ -59,7 +59,7 @@ var ActivitiRest = {
//console.log("ajax returned data");
var highLights = data;
if (!highLights) {
console.log("highLights not found");
//console.log("highLights not found");
return;
} else {
callback.apply({highLights: highLights});
......@@ -70,5 +70,5 @@ var ActivitiRest = {
}).fail(function(jqXHR, textStatus, error){
//console.log('Get HighLights['+processInstanceId+'] failure: ', textStatus, jqXHR);
});
},
}
};
\ No newline at end of file
......@@ -262,7 +262,7 @@ var ProcessDiagramGenerator = {
processDiagramCanvas.setConextObject(activityImpl);
// TODO:
console.error("task is not implemented yet");
//console.error("task is not implemented yet");
/*
var activityImpl = this;
processDiagramCanvas.drawTask(activityImpl.getProperty("name"), activityImpl.getX(), activityImpl.getY(), activityImpl.getWidth(), activityImpl.getHeight(), thickBorder);
......@@ -473,7 +473,7 @@ var ProcessDiagramGenerator = {
if (this.getProcessDiagram(processDefinitionId) != undefined) {
// TODO: may be reset canvas if exists.. Or just show
console.log("ProcessDiagram '" + processDefinitionId + "' is already generated. Just show it.");
//console.log("ProcessDiagram '" + processDefinitionId + "' is already generated. Just show it.");
return;
}
var processDiagram = this.initProcessDiagramCanvas(processDefinitionDiagramLayout);
......@@ -482,7 +482,7 @@ var ProcessDiagramGenerator = {
// Draw pool shape, if process is participant in collaboration
if(processDefinitionDiagramLayout.participantProcess != undefined) {
console.log("Draw pool shape");
//console.log("Draw pool shape");
var pProc = processDefinitionDiagramLayout.participantProcess;
processDiagramCanvas.drawPoolOrLane(pProc.x, pProc.y, pProc.width, pProc.height, pProc.name);
}
......@@ -504,7 +504,7 @@ var ProcessDiagramGenerator = {
cnt += sequenceFlows.length;
var step = (cnt>0)? 100/cnt : 0;
var progress = 0;
console.log("progress bar step: ", step);
//console.log("progress bar step: ", step);
var task1 = new $.AsyncQueue();
......@@ -512,7 +512,7 @@ var ProcessDiagramGenerator = {
task1.add(function (task1) {
if (!laneSets) laneSets = [];
console.log("> draw lane sets, count:", laneSets.length)
//console.log("> draw lane sets, count:", laneSets.length)
});
for(var i in laneSets) {
......@@ -523,7 +523,7 @@ var ProcessDiagramGenerator = {
progress += step;
pb1.set('value', parseInt(progress));
console.log("--> laneId: " + lane.name + ", name: " + lane.name);
//console.log("--> laneId: " + lane.name + ", name: " + lane.name);
processDiagramCanvas.drawPoolOrLane(lane.x, lane.y, lane.width, lane.height, lane.name);
});
......@@ -533,7 +533,7 @@ var ProcessDiagramGenerator = {
task1.add(function (task1) {
if (!activities) activities = [];
console.log("> draw activities, count:", activities.length)
//console.log("> draw activities, count:", activities.length)
});
var activitiesLength = activities.length;
......@@ -542,7 +542,7 @@ var ProcessDiagramGenerator = {
activitiesLength --;
progress += step;
pb1.set('value', parseInt(progress));
console.log(activitiesLength, "--> activityId: " + activity.getId() + ", name: " + activity.getProperty("name"));
//console.log(activitiesLength, "--> activityId: " + activity.getId() + ", name: " + activity.getProperty("name"));
ProcessDiagramGenerator.drawActivity(processDiagramCanvas, activity);
});
......@@ -550,7 +550,7 @@ var ProcessDiagramGenerator = {
task1.add(function (task1) {
if (!sequenceFlows) sequenceFlows = [];
console.log("> draw sequence flows, count:", sequenceFlows.length)
//console.log("> draw sequence flows, count:", sequenceFlows.length)
});
var flowsLength = sequenceFlows.length;
......@@ -579,7 +579,7 @@ var ProcessDiagramGenerator = {
progress += step;
pb1.set('value', parseInt(progress));
console.log(flowsLength, "--> flow: " + flow.flow);
//console.log(flowsLength, "--> flow: " + flow.flow);
processDiagramCanvas.setConextObject(flow);
processDiagramCanvas.drawSequenceflow(waypoints, isConditional, isDefault, isHighLighted);
......@@ -588,9 +588,9 @@ var ProcessDiagramGenerator = {
task1.onComplete(function(){
if (progress<100)
pb1.set('value', 100);
console.log("COMPLETE!!!");
//console.log("COMPLETE!!!");
console.timeEnd('generateDiagram');
//console.timeEnd('generateDiagram');
});
task1.run();
......@@ -712,7 +712,7 @@ var ProcessDiagramGenerator = {
if (drawInstruction != null) {
drawInstruction.apply({processDiagramCanvas:processDiagramCanvas, activity:activity});
} else {
console.error("no drawInstruction for " + type + ": ", activity);
//console.error("no drawInstruction for " + type + ": ", activity);
}
// Actually draw the markers
......@@ -735,13 +735,13 @@ var ProcessDiagramGenerator = {
setHighLights: function(highLights){
if (highLights.processDefinitionId == undefined) {
console.error("Process instance " + highLights.processInstanceId + " doesn't exist");
//console.error("Process instance " + highLights.processInstanceId + " doesn't exist");
return;
}
var processDiagram = this.getProcessDiagram(highLights.processDefinitionId);
if (processDiagram == undefined) {
console.error("Process diagram " + highLights.processDefinitionId + " not found");
//console.error("Process diagram " + highLights.processDefinitionId + " not found");
return;
}
......@@ -822,7 +822,7 @@ var ProcessDiagramGenerator = {
var processDiagram = ProcessDiagramGenerator.getProcessDiagram(processDefinitionId);
if (processDiagram != undefined && processDiagram != null) {
console.log("Process diagram " + processDefinitionId + " is already loaded");
//console.log("Process diagram " + processDefinitionId + " is already loaded");
//return;
var diagram = document.getElementById(processDefinitionId);
......@@ -835,7 +835,7 @@ var ProcessDiagramGenerator = {
return;
}
console.time('loadDiagram');
//console.time('loadDiagram');
// Load processDefinition
......@@ -844,10 +844,10 @@ var ProcessDiagramGenerator = {
_generateDiagram: function() {
var processDefinitionDiagramLayout = this.processDefinitionDiagramLayout;
console.log("process-definition-diagram-layout["+processDefinitionDiagramLayout.processDefinition.id+"]: ", processDefinitionDiagramLayout);
//console.log("process-definition-diagram-layout["+processDefinitionDiagramLayout.processDefinition.id+"]: ", processDefinitionDiagramLayout);
console.timeEnd('loadDiagram');
console.time('generateDiagram');
//console.timeEnd('loadDiagram');
//console.time('generateDiagram');
pb1.set('value', 0);
ProcessDiagramGenerator.generateDiagram(processDefinitionDiagramLayout);
......@@ -862,20 +862,20 @@ var ProcessDiagramGenerator = {
type: 'POST',
dataType: 'json',
cache: false,
async: false,
async: false
}).done(function(data) {
console.log("ajax returned data");
//console.log("ajax returned data");
//console.log("ajax returned data:", data);
processDefinition = data;
if (!processDefinition) {
console.error("Process definition '" + processDefinitionKey + "' not found");
//console.error("Process definition '" + processDefinitionKey + "' not found");
}
}).fail(function(jqXHR, textStatus){
console.error('Get diagram layout['+processDefinitionKey+'] failure: ', textStatus, jqXHR);
//console.error('Get diagram layout['+processDefinitionKey+'] failure: ', textStatus, jqXHR);
});
if (processDefinition) {
console.log("Get process definition by key '" + processDefinitionKey + "': ", processDefinition.id);
//console.log("Get process definition by key '" + processDefinitionKey + "': ", processDefinition.id);
return processDefinition;
} else {
return null;
......@@ -945,7 +945,7 @@ var ProcessDiagramGenerator = {
var li = $(this),
id = li.attr("id"),
processDefinitionId = li.attr("processDefinitionId");
console.warn("_breadCrumbsItemClick: ", id, ", processDefinitionId: ", processDefinitionId);
//console.warn("_breadCrumbsItemClick: ", id, ", processDefinitionId: ", processDefinitionId);
var ul = ProcessDiagramGenerator.diagramBreadCrumbs.one("ul");
ul.find("li").removeClass("selected");
......
......@@ -61,7 +61,7 @@
// TODO: add callback for queue[i] complete
var obj = arguments[0];
if (obj && Array.isArray(obj)) {
if (obj && Object.prototype.toString.call(obj) === "[object Array]") {
var fn = arguments[1];
var timeOut = (typeof(arguments[2]) != "undefined")? arguments[2] : defaultTimeOut;
if (typeof(fn) == "function") {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册