提交 72987bd9 编写于 作者: H Henry Yan

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

* 'master' of git://github.com/Activiti/Activiti:
  ACT-1593: cont. basics for simple reporting capabilities
  ACT-1397 and diagram view cleanup
  ACT-995 fix
  ACT-1593: cont. basics for simple reporting capabilities
  ACT-1593: cont. basics for simple reporting capabilities
......@@ -13,14 +13,12 @@
package org.activiti.engine;
import java.util.List;
import java.util.Map;
import org.activiti.engine.identity.Group;
import org.activiti.engine.identity.GroupQuery;
import org.activiti.engine.identity.Picture;
import org.activiti.engine.identity.User;
import org.activiti.engine.identity.UserQuery;
import org.activiti.engine.impl.identity.Account;
/**
......@@ -131,29 +129,4 @@ public interface IdentityService {
/** Delete an entry of the generic extensibility key-value pairs associated with a user */
void deleteUserInfo(String userId, String key);
/**
* Store account information for a remote system
* @deprecated Will be removed in Activiti 5.12
*/
void setUserAccount(String userId, String userPassword, String accountName, String accountUsername, String accountPassword, Map<String, String> accountDetails);
/**
* Get account names associated with the given user
*
* @deprecated Will be removed in Activiti 5.12
*/
List<String> getUserAccountNames(String userId);
/**
* Get account information associated with a user
* @deprecated Will be removed in Activiti 5.12
*/
Account getUserAccount(String userId, String userPassword, String accountName);
/**
* Delete an entry of the generic extensibility key-value pairs associated with a user
* @deprecated Will be removed in Activiti 5.12
*/
void deleteUserAccount(String userId, String accountName);
}
......@@ -13,7 +13,6 @@
package org.activiti.engine.impl;
import java.util.List;
import java.util.Map;
import org.activiti.engine.IdentityService;
import org.activiti.engine.identity.Group;
......@@ -31,7 +30,6 @@ import org.activiti.engine.impl.cmd.DeleteGroupCmd;
import org.activiti.engine.impl.cmd.DeleteMembershipCmd;
import org.activiti.engine.impl.cmd.DeleteUserCmd;
import org.activiti.engine.impl.cmd.DeleteUserInfoCmd;
import org.activiti.engine.impl.cmd.GetUserAccountCmd;
import org.activiti.engine.impl.cmd.GetUserInfoCmd;
import org.activiti.engine.impl.cmd.GetUserInfoKeysCmd;
import org.activiti.engine.impl.cmd.GetUserPictureCmd;
......@@ -39,7 +37,6 @@ import org.activiti.engine.impl.cmd.SaveGroupCmd;
import org.activiti.engine.impl.cmd.SaveUserCmd;
import org.activiti.engine.impl.cmd.SetUserInfoCmd;
import org.activiti.engine.impl.cmd.SetUserPictureCmd;
import org.activiti.engine.impl.identity.Account;
import org.activiti.engine.impl.identity.Authentication;
import org.activiti.engine.impl.persistence.entity.GroupEntity;
import org.activiti.engine.impl.persistence.entity.IdentityInfoEntity;
......@@ -114,10 +111,6 @@ public class IdentityServiceImpl extends ServiceImpl implements IdentityService
return commandExecutor.execute(new GetUserInfoKeysCmd(userId, IdentityInfoEntity.TYPE_USERINFO));
}
public List<String> getUserAccountNames(String userId) {
return commandExecutor.execute(new GetUserInfoKeysCmd(userId, IdentityInfoEntity.TYPE_USERACCOUNT));
}
public void setUserInfo(String userId, String key, String value) {
commandExecutor.execute(new SetUserInfoCmd(userId, key, value));
}
......@@ -125,16 +118,4 @@ public class IdentityServiceImpl extends ServiceImpl implements IdentityService
public void deleteUserInfo(String userId, String key) {
commandExecutor.execute(new DeleteUserInfoCmd(userId, key));
}
public void deleteUserAccount(String userId, String accountName) {
commandExecutor.execute(new DeleteUserInfoCmd(userId, accountName));
}
public Account getUserAccount(String userId, String userPassword, String accountName) {
return commandExecutor.execute(new GetUserAccountCmd(userId, userPassword, accountName));
}
public void setUserAccount(String userId, String userPassword, String accountName, String accountUsername, String accountPassword, Map<String, String> accountDetails) {
commandExecutor.execute(new SetUserInfoCmd(userId, userPassword, accountName, accountUsername, accountPassword, accountDetails));
}
}
......@@ -42,16 +42,6 @@ public class SetUserInfoCmd implements Command<Object>, Serializable {
this.value = value;
}
public SetUserInfoCmd(String userId, String userPassword, String accountName, String accountUsername, String accountPassword, Map<String, String> accountDetails) {
this.userId = userId;
this.userPassword = userPassword;
this.type = IdentityInfoEntity.TYPE_USERACCOUNT;
this.key = accountName;
this.value = accountUsername;
this.accountPassword = accountPassword;
this.accountDetails = accountDetails;
}
public Object execute(CommandContext commandContext) {
commandContext
.getIdentityInfoEntityManager()
......
......@@ -19,17 +19,15 @@ import java.util.Map;
import org.activiti.engine.impl.db.HasRevision;
import org.activiti.engine.impl.db.PersistentObject;
import org.activiti.engine.impl.identity.Account;
/**
* @author Tom Baeyens
*/
public class IdentityInfoEntity implements PersistentObject, HasRevision, Account, Serializable {
public class IdentityInfoEntity implements PersistentObject, HasRevision, Serializable {
private static final long serialVersionUID = 1L;
public static final String TYPE_USERACCOUNT = "account";
public static final String TYPE_USERINFO = "userinfo";
protected String id;
......
......@@ -37,36 +37,8 @@ public class IdentityInfoEntityManager extends AbstractManager {
public void deleteIdentityInfo(IdentityInfoEntity identityInfo) {
getDbSqlSession().delete(identityInfo);
if (IdentityInfoEntity.TYPE_USERACCOUNT.equals(identityInfo.getType())) {
for (IdentityInfoEntity identityInfoDetail: findIdentityInfoDetails(identityInfo.getId())) {
getDbSqlSession().delete(identityInfoDetail);
}
}
}
public IdentityInfoEntity findUserAccountByUserIdAndKey(String userId, String userPassword, String key) {
IdentityInfoEntity identityInfoEntity = findUserInfoByUserIdAndKey(userId, key);
if (identityInfoEntity==null) {
return null;
}
Map<String,String> details = new HashMap<String, String>();
String identityInfoId = identityInfoEntity.getId();
List<IdentityInfoEntity> identityInfoDetails = findIdentityInfoDetails(identityInfoId);
for (IdentityInfoEntity identityInfoDetail: identityInfoDetails) {
details.put(identityInfoDetail.getKey(), identityInfoDetail.getValue());
}
identityInfoEntity.setDetails(details);
if (identityInfoEntity.getPasswordBytes()!=null) {
String password = decryptPassword(identityInfoEntity.getPasswordBytes(), userPassword);
identityInfoEntity.setPassword(password);
}
return identityInfoEntity;
}
@SuppressWarnings("unchecked")
protected List<IdentityInfoEntity> findIdentityInfoDetails(String identityInfoId) {
return Context
.getCommandContext()
......
......@@ -103,6 +103,9 @@ public class VariableInstanceEntity implements ValueFields, PersistentObject, Ha
if (textValue != null) {
persistentState.put("textValue", textValue);
}
if (textValue2 != null) {
persistentState.put("textValue2", textValue2);
}
if (byteArrayValueId != null) {
persistentState.put("byteArrayValueId", byteArrayValueId);
}
......
......@@ -13,11 +13,8 @@
package org.activiti.engine.test.api.identity;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.ActivitiIllegalArgumentException;
......@@ -25,7 +22,6 @@ import org.activiti.engine.ActivitiOptimisticLockingException;
import org.activiti.engine.identity.Group;
import org.activiti.engine.identity.Picture;
import org.activiti.engine.identity.User;
import org.activiti.engine.impl.identity.Account;
import org.activiti.engine.impl.test.PluggableActivitiTestCase;
/**
......@@ -49,69 +45,6 @@ public class IdentityServiceTest extends PluggableActivitiTestCase {
identityService.deleteUser(user.getId());
}
public void testUserAccount() {
User user = identityService.newUser("testuser");
identityService.saveUser(user);
identityService.setUserAccount("testuser", "123", "google", "mygoogleusername", "mygooglepwd", null);
Account googleAccount = identityService.getUserAccount("testuser", "123", "google");
assertEquals("google", googleAccount.getName());
assertEquals("mygoogleusername", googleAccount.getUsername());
assertEquals("mygooglepwd", googleAccount.getPassword());
identityService.setUserAccount("testuser", "123", "google", "mygoogleusername2", "mygooglepwd2", null);
googleAccount = identityService.getUserAccount("testuser", "123", "google");
assertEquals("google", googleAccount.getName());
assertEquals("mygoogleusername2", googleAccount.getUsername());
assertEquals("mygooglepwd2", googleAccount.getPassword());
identityService.setUserAccount("testuser", "123", "alfresco", "myalfrescousername", "myalfrescopwd", null);
identityService.setUserInfo("testuser", "myinfo", "myvalue");
identityService.setUserInfo("testuser", "myinfo2", "myvalue2");
List<String> expectedUserAccountNames = new ArrayList<String>();
expectedUserAccountNames.add("google");
expectedUserAccountNames.add("alfresco");
List<String> userAccountNames = identityService.getUserAccountNames("testuser");
assertListElementsMatch(expectedUserAccountNames, userAccountNames);
identityService.deleteUserAccount("testuser", "google");
expectedUserAccountNames.remove("google");
userAccountNames = identityService.getUserAccountNames("testuser");
assertListElementsMatch(expectedUserAccountNames, userAccountNames);
identityService.deleteUser(user.getId());
}
private void assertListElementsMatch(List<String> list1, List<String> list2) {
if(list1 != null) {
assertNotNull(list2);
assertEquals(list1.size(), list2.size());
for (String value : list1) {
assertTrue(list2.contains(value));
}
} else {
assertNull(list2);
}
}
public void testUserAccountDetails() {
User user = identityService.newUser("testuser");
identityService.saveUser(user);
Map<String, String> accountDetails = new HashMap<String, String>();
accountDetails.put("server", "localhost");
accountDetails.put("port", "35");
identityService.setUserAccount("testuser", "123", "google", "mygoogleusername", "mygooglepwd", accountDetails);
Account googleAccount = identityService.getUserAccount("testuser", "123", "google");
assertEquals(accountDetails, googleAccount.getDetails());
identityService.deleteUser(user.getId());
}
public void testCreateExistingUser() {
User user = identityService.newUser("testuser");
identityService.saveUser(user);
......
......@@ -331,6 +331,39 @@ public class JPAVariableTest extends AbstractActivitiTestCase {
assertEquals(bigIntegerIdJPAEntity.getBigIntegerId(), ((BigIntegerIdJPAEntity)bigIntegerIdResult).getBigIntegerId());
}
// http://jira.codehaus.org/browse/ACT-995
@Deployment(resources="org/activiti/standalone/jpa/JPAVariableTest.testQueryJPAVariable.bpmn20.xml")
public void testReplaceExistingJPAEntityWithAnotherOfSameType() {
EntityManager manager = entityManagerFactory.createEntityManager();
manager.getTransaction().begin();
// Old variable that gets replaced
FieldAccessJPAEntity oldVariable = new FieldAccessJPAEntity();
oldVariable.setId(11L);
oldVariable.setValue("value1");
manager.persist(oldVariable);
// New variable
FieldAccessJPAEntity newVariable = new FieldAccessJPAEntity();
newVariable.setId(12L);
newVariable.setValue("value2");
manager.persist(newVariable);
manager.flush();
manager.getTransaction().commit();
manager.close();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("JPAVariableProcess");
String executionId = processInstance.getId();
String variableName = "testVariable";
runtimeService.setVariable(executionId, variableName, oldVariable);
runtimeService.setVariable(executionId, variableName, newVariable);
Object variable = runtimeService.getVariable(executionId, variableName);
assertEquals(newVariable.getId(), ((FieldAccessJPAEntity) variable).getId());
}
@Deployment
public void testIllegalEntities() {
......
......@@ -73,7 +73,6 @@
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<!-- Database -->
......@@ -126,6 +125,14 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<!-- Vaadin add-ons -->
<!-- Must be defined both in activiti-explorer and activiti-webapp-explorer, as otherwise the gwt compiler won't find it -->
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>dcharts-widget</artifactId>
<version>0.10.0</version>
</dependency>
</dependencies>
......@@ -158,6 +165,10 @@
<id>buzzmedia</id>
<url>http://maven.thebuzzmedia.com</url> <!-- ImageScalr -->
</repository>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
</project>
......@@ -283,6 +283,10 @@ public interface Messages {
// Reporting menu
String REPORTING_MENU_RUN_REPORTS = "reporting.menu.run.reports";
String REPORTING_MENU_SAVED_REPORTS = "reporting.menu.saved.reports";
String REPORTING_SAVE_POPUP_CAPTION = "reporting.save.popup.caption";
String REPORTING_SAVE_POPUP_NAME = "reporting.save.popup.name";
String REPORTING_SAVE_POPUP_NAME_EXISTS = "reporting.save.popup.name.exists";
String REPORTING_SAVE_POPUP_NAME_TOO_LONG = "reporting.save.popup..name.too.long";
// Management menu
String MGMT_MENU_DATABASE = "management.menu.database";
......
......@@ -184,7 +184,7 @@ public class DemoDataGenerator implements ModelDataJsonConstants {
deploymentList = repositoryService.createDeploymentQuery().deploymentName(reportDeploymentName).list();
if (deploymentList == null || deploymentList.size() == 0) {
repositoryService.createDeployment()
.name(deploymentName)
.name(reportDeploymentName)
.addClasspathResource("org/activiti/explorer/demo/process/reports/taskDurationForProcessDefinition.bpmn20.xml")
.deploy();
}
......
/* 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.reporting;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.repository.ProcessDefinition;
/**
* @author Joram Barrez
*/
public class ReportingUtil {
public static Connection getCurrentDatabaseConnection() {
return Context.getCommandContext().getDbSqlSession().getSqlSession().getConnection();
}
public static ResultSet executeSelectSqlQuery(String sql) throws Exception {
Connection connection = getCurrentDatabaseConnection();
Statement select = connection.createStatement();
return select.executeQuery(sql);
}
public static ProcessDefinition getProcessDefinition(DelegateExecution delegateExecution) {
ExecutionEntity executionEntity = (ExecutionEntity) delegateExecution;
if (executionEntity.getProcessDefinition() != null) {
return (ProcessDefinition) executionEntity.getProcessDefinition();
} else {
return ProcessEngines.getDefaultProcessEngine()
.getRepositoryService()
.createProcessDefinitionQuery()
.processDefinitionId(delegateExecution.getProcessDefinitionId())
.singleResult();
}
}
}
......@@ -69,7 +69,7 @@ public class ImageAttachmentRenderer extends GenericAttachmentRenderer {
String mimeType = extractMineType(attachment.getType());
InputStream imageStream = ImageUtil.smallify(taskService.getAttachmentContent(attachment.getId()), mimeType, 900, 550);
InputStream imageStream = ImageUtil.resizeImage(taskService.getAttachmentContent(attachment.getId()), mimeType, 900, 550);
Resource resource = new StreamResource(new InputStreamStreamSource(imageStream),
attachment.getName() + extractExtention(attachment.getType()),ExplorerApp.get());
Embedded image = new Embedded(null, resource);
......
......@@ -25,6 +25,7 @@ import com.vaadin.ui.Field;
/**
* @author Frederik Heremans
* @author Joram Barrez
*/
public class EnumFormPropertyRenderer extends AbstractFormPropertyRenderer {
......@@ -39,17 +40,30 @@ public class EnumFormPropertyRenderer extends AbstractFormPropertyRenderer {
comboBox.setRequired(formProperty.isRequired());
comboBox.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty)));
comboBox.setEnabled(formProperty.isWritable());
comboBox.setNullSelectionAllowed(false);
Object firstItemId = null;
Map<String, String> values = (Map<String, String>) formProperty.getType().getInformation("values");
if (values != null) {
for (Entry<String, String> enumEntry : values.entrySet()) {
// Add value and label (if any)
comboBox.addItem(enumEntry.getKey());
if (firstItemId == null) {
firstItemId = enumEntry.getKey(); // select first element
}
if (enumEntry.getValue() != null) {
comboBox.setItemCaption(enumEntry.getKey(), enumEntry.getValue());
}
}
}
// Select first element
if (firstItemId != null) {
comboBox.select(firstItemId);
}
return comboBox;
}
}
......@@ -54,6 +54,12 @@ public class ProcessDefinitionFormPropertyRenderer extends AbstractFormPropertyR
comboBox.setItemCaption(processDefinition.getId(), name);
}
// Select first
if (processDefinitions.size() > 0) {
comboBox.setNullSelectionAllowed(false);
comboBox.select(processDefinitions.get(0).getId());
}
return comboBox;
}
......
......@@ -10,35 +10,39 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.explorer.ui.reports;
package org.activiti.engine.impl.cmd;
import org.dussan.vaadin.dcharts.DCharts;
import java.io.Serializable;
import org.activiti.engine.impl.identity.Account;
import org.activiti.engine.impl.interceptor.Command;
import org.activiti.engine.impl.interceptor.CommandContext;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Reindeer;
/**
* @author Tom Baeyens
* @author Joram Barrez
*/
public class GetUserAccountCmd implements Command<Account>, Serializable {
private static final long serialVersionUID = 1L;
protected String userId;
protected String userPassword;
protected String accountName;
public class ChartComponent extends VerticalLayout {
public GetUserAccountCmd(String userId, String userPassword, String accountName) {
this.userId = userId;
this.userPassword = userPassword;
this.accountName = accountName;
}
private static final long serialVersionUID = 1L;
public Account execute(CommandContext commandContext) {
return commandContext
.getIdentityInfoEntityManager()
.findUserAccountByUserIdAndKey(userId, userPassword, accountName);
public ChartComponent(String description, DCharts dCharts) {
addComponent(new Label("&nbsp;", Label.CONTENT_XHTML));
addComponent(new Label("&nbsp;", Label.CONTENT_XHTML));
// Description
Label label = new Label(description);
label.addStyleName(Reindeer.LABEL_H2);
addComponent(label);
addComponent(new Label("&nbsp;", Label.CONTENT_XHTML));
// Chart
dCharts.setWidth(600, UNITS_PIXELS);
dCharts.setHeight(500, UNITS_PIXELS);
addComponent(dCharts);
dCharts.show();
}
}
/* 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.Iterator;
import org.activiti.engine.ActivitiException;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.dussan.vaadin.dcharts.DCharts;
import org.dussan.vaadin.dcharts.base.elements.XYaxis;
import org.dussan.vaadin.dcharts.data.DataSeries;
import org.dussan.vaadin.dcharts.data.Ticks;
import org.dussan.vaadin.dcharts.metadata.renderers.AxisRenderers;
import org.dussan.vaadin.dcharts.metadata.renderers.SeriesRenderers;
import org.dussan.vaadin.dcharts.options.Axes;
import org.dussan.vaadin.dcharts.options.Highlighter;
import org.dussan.vaadin.dcharts.options.Options;
import org.dussan.vaadin.dcharts.options.SeriesDefaults;
/**
* @author Joram Barrez
*/
public class ChartGenerator {
public static final String CHART_TYPE_BAR_CHART = "barChart";
public static final String CHART_TYPE_PIE_CHART = "pieChart";
public static ChartComponent generateChart(byte[] reportData) {
// Convert json to pojo
JsonNode jsonNode = convert(reportData);
JsonNode dataNode = jsonNode.get("data");
// Retrieve data
String description = jsonNode.get("description").getTextValue();
String[] names = new String[dataNode.size()];
Number[] values = new Number[dataNode.size()];
int index = 0;
Iterator<String> fieldIterator = dataNode.getFieldNames();
while(fieldIterator.hasNext()) {
String field = fieldIterator.next();
names[index] = field;
values[index] = dataNode.get(field).getNumberValue();
index++;
}
// Create chart
String type = jsonNode.get("type").getTextValue();
DCharts chart = null;
if (CHART_TYPE_BAR_CHART.equals(type)) {
DataSeries dataSeries = new DataSeries().add((Object[]) values);
SeriesDefaults seriesDefaults = new SeriesDefaults().setRenderer(SeriesRenderers.BAR);
Axes axes = new Axes().addAxis(new XYaxis().setRenderer(AxisRenderers.CATEGORY).setTicks(new Ticks().add((Object[]) names)));
Highlighter highlighter = new Highlighter().setShow(false);
Options options = new Options().setSeriesDefaults(seriesDefaults).setAxes(axes).setHighlighter(highlighter);
options.setAnimate(true);
options.setAnimateReplot(true);
chart = new DCharts().setDataSeries(dataSeries).setOptions(options);
} else if(CHART_TYPE_PIE_CHART.equals(type)) {
DataSeries dataSeries = new DataSeries().newSeries();
for (int i=0; i<names.length; i++) {
dataSeries.add(names[i], values[i]);
}
SeriesDefaults seriesDefaults = new SeriesDefaults().setRenderer(SeriesRenderers.PIE);
Options options = new Options().setSeriesDefaults(seriesDefaults);
options.setAnimate(true);
options.setAnimateReplot(true);
chart = new DCharts().setDataSeries(dataSeries).setOptions(options);
}
return new ChartComponent(description, chart);
}
protected static JsonNode convert(byte[] jsonBytes) {
try {
ObjectMapper objectMapper = new ObjectMapper();
return objectMapper.readTree(jsonBytes);
} catch (Exception e) {
throw new ActivitiException("Report dataset contains invalid json", e);
}
}
}
......@@ -15,6 +15,7 @@ package org.activiti.explorer.ui.reports;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.form.StartFormData;
import org.activiti.engine.history.HistoricVariableInstance;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.explorer.ExplorerApp;
......@@ -27,7 +28,11 @@ import org.activiti.explorer.ui.form.FormPropertiesEventListener;
import org.activiti.explorer.ui.form.FormPropertiesForm;
import org.activiti.explorer.ui.form.FormPropertiesForm.FormPropertiesEvent;
import org.activiti.explorer.ui.mainlayout.ExplorerLayout;
import org.activiti.explorer.ui.management.processdefinition.ChangeProcessSuspensionStatePopupWindow;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
......@@ -78,8 +83,7 @@ public class ReportDetailPanel extends DetailPanel {
detailContainer.setSizeFull();
initForm();
// initActions(parentPage);
initActions();
}
protected void initHeader() {
......@@ -112,6 +116,25 @@ public class ReportDetailPanel extends DetailPanel {
propertiesLayout.addComponent(versionLabel);
}
protected void initActions() {
Button saveButton = new Button(i18nManager.getMessage(Messages.BUTTON_SAVE));
saveButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
ChangeProcessSuspensionStatePopupWindow popupWindow =
new ChangeProcessSuspensionStatePopupWindow(processDefinition.getId(), parentPage, false);
ExplorerApp.get().getViewManager().showPopupWindow(popupWindow);
}
});
// Clear toolbar and add 'start' button
parentPage.getToolBar().removeAllButtons();
parentPage.getToolBar().addButton(saveButton);
}
protected void initForm() {
// Check if a start form is defined
final ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
......@@ -119,29 +142,60 @@ public class ReportDetailPanel extends DetailPanel {
if(startFormData != null && ((startFormData.getFormProperties() != null && startFormData.getFormProperties().size() > 0) || startFormData.getFormKey() != null)) {
processDefinitionStartForm = new FormPropertiesForm();
detailContainer.addComponent(processDefinitionStartForm);
processDefinitionStartForm.setFormProperties(startFormData.getFormProperties());
processDefinitionStartForm.setSubmitButtonCaption("Generate report");
processDefinitionStartForm.hideCancelButton();
processDefinitionStartForm.addListener(new FormPropertiesEventListener() {
private static final long serialVersionUID = 1L;
protected void handleFormSubmit(FormPropertiesEvent event) {
processEngine.getFormService().submitStartFormData(processDefinition.getId(), event.getFormProperties());
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
// Report is generated by a process
ProcessInstance processInstance = processEngine.getFormService()
.submitStartFormData(processDefinition.getId(), event.getFormProperties());
generateReport(processInstance);
}
protected void handleFormCancel(FormPropertiesEvent event) {
// Not needed
// Not needed, cancel button not shown in report panels
}
});
detailContainer.addComponent(processDefinitionStartForm);
} else {
// Just start the process-instance since it has no form.
ProcessInstance processInstance = processEngine.getRuntimeService().startProcessInstanceById(processDefinition.getId());
generateReport(processInstance);
}
}
protected void generateReport(ProcessInstance processInstance) {
// Report dataset is stored as historical variable as json
HistoricVariableInstance historicVariableInstance = ProcessEngines.getDefaultProcessEngine()
.getHistoryService()
.createHistoricVariableInstanceQuery()
.processInstanceId(processInstance.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
if (processDefinitionStartForm != null) {
detailContainer.removeComponent(processDefinitionStartForm);
processDefinitionStartForm = null;
}
detailContainer.addComponent(chart);
}
protected String getReportDisplayName() {
......
......@@ -10,26 +10,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.explorer.ui.reports;
package org.activiti.engine.impl.identity;
import java.util.Map;
import org.activiti.explorer.ExplorerApp;
import org.activiti.explorer.I18nManager;
import org.activiti.explorer.Messages;
import org.activiti.explorer.ui.custom.PopupWindow;
/**
* @author Tom Baeyens
*
* @deprecated Will be removed in Activiti 5.12
* @author Joram Barrez
*/
public interface Account {
public class SaveReportPopupWindow extends PopupWindow {
private static final long serialVersionUID = 1L;
String NAME_ALFRESCO = "Alfresco";
String NAME_GOOGLE = "Google";
String NAME_SKYPE = "Skype";
String NAME_MAIL = "Mail";
public SaveReportPopupWindow() {
I18nManager i18nManager = ExplorerApp.get().getI18nManager();
setCaption(i18nManager.getMessage(Messages.REPORTING_SAVE_POPUP_CAPTION));
}
String getName();
String getUsername();
String getPassword();
Map<String, String> getDetails();
}
......@@ -41,7 +41,7 @@ public class ImageUtil {
* If the image is smaller then the given maximum width or height, the image
* will be proportionally resized.
*/
public static InputStream smallify(InputStream imageInputStream, String mimeType, int maxWidth, int maxHeight) {
public static InputStream resizeImage(InputStream imageInputStream, String mimeType, int maxWidth, int maxHeight) {
try {
BufferedImage image = ImageIO.read(imageInputStream);
......
......@@ -264,6 +264,10 @@ process.delete.popup.delete.button = Delete
#Reporting menu
reporting.menu.run.reports = Run reports
reporting.menu.saved.reports = Saved reports
reporting.save.popup.caption = Save this report
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: too long.
# Management menu
management.menu.database = Database
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>Activiti - Webapp - Explorer V2</name>
<artifactId>activiti-webapp-explorer2</artifactId>
<packaging>war</packaging>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.activiti</groupId>
<artifactId>activiti-root</artifactId>
<relativePath>../..</relativePath>
<version>5.12-SNAPSHOT</version>
</parent>
<name>Activiti - Webapp - Explorer V2</name>
<artifactId>activiti-webapp-explorer2</artifactId>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<parent>
<groupId>org.activiti</groupId>
<artifactId>activiti-root</artifactId>
<relativePath>../..</relativePath>
<version>5.12-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/ui-jar.xml</descriptor>
</descriptors>
</configuration>
</plugin>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- Compile custom GWT components or widget dependencies with the GWT compiler
Needed for eg. Animator component
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0</version>
<configuration>
<webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<runTarget>activiti-explorer2</runTarget>
<hostedWebapp>src/main/webapp</hostedWebapp>
<noServer>true</noServer>
<port>8080</port>
<soyc>false</soyc>
</configuration>
<executions>
<execution>
<goals>
<goal>resources</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<goals>
<goal>update-widgetset</goal>
</goals>
</execution>
</executions>
</plugin> -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/ui-jar.xml</descriptor>
</descriptors>
</configuration>
</plugin>
<!-- A simple Jetty test server at http://localhost:8080/activiti-webapp-explorer2 can be launched with the Maven goal jetty:run
and stopped with jetty:stop -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.24</version>
<configuration>
<stopPort>9966</stopPort>
<stopKey>activiti-webapp-explorer2</stopKey>
<!-- Redeploy every x seconds if changes are detected, 0 for no automatic redeployment -->
<scanIntervalSeconds>0</scanIntervalSeconds>
<!-- make sure Jetty also finds the widgetset -->
<webAppConfig>
<contextPath>/activiti-explorer2</contextPath>
<baseResource implementation="org.mortbay.resource.ResourceCollection">
<!-- Workaround for Maven/Jetty issue http://jira.codehaus.org/browse/JETTY-680 -->
<!-- <resources>src/main/webapp,${project.build.directory}/${project.build.finalName}</resources> -->
<resourcesAsCSV>src/main/webapp</resourcesAsCSV>
</baseResource>
</webAppConfig>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.zeroturnaround
</groupId>
<artifactId>
jrebel-maven-plugin
</artifactId>
<versionRange>
[1.0.7,)
</versionRange>
<goals>
<goal>generate</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<!-- A simple Jetty test server at http://localhost:8080/activiti-webapp-explorer2
can be launched with the Maven goal jetty:run and stopped with jetty:stop -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.24</version>
<configuration>
<stopPort>9966</stopPort>
<stopKey>activiti-webapp-explorer2</stopKey>
<!-- Redeploy every x seconds if changes are detected, 0 for no automatic
redeployment -->
<scanIntervalSeconds>0</scanIntervalSeconds>
<!-- make sure Jetty also finds the widgetset -->
<webAppConfig>
<contextPath>/activiti-explorer2</contextPath>
<baseResource implementation="org.mortbay.resource.ResourceCollection">
<!-- Workaround for Maven/Jetty issue http://jira.codehaus.org/browse/JETTY-680 -->
<!-- <resources>src/main/webapp,${project.build.directory}/${project.build.finalName}</resources> -->
<resourcesAsCSV>src/main/webapp</resourcesAsCSV>
</baseResource>
</webAppConfig>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.zeroturnaround
</groupId>
<artifactId>
jrebel-maven-plugin
</artifactId>
<versionRange>
[1.0.7,)
</versionRange>
<goals>
<goal>generate</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<!-- Activiti -->
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-explorer</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-modeler</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-diagram-rest</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-simple-workflow</artifactId>
</dependency>
<!-- Database -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<!-- Running example processes -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</dependency>
<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>buzzmedia</id>
<url>http://maven.thebuzzmedia.com</url> <!-- ImageScalr -->
</repository>
<repository>
<id>Alfresco thirdparty</id>
<url>https://maven.alfresco.com/nexus/content/repositories/thirdparty/</url>
</repository>
</repositories>
<profiles>
<profile>
<id>compile-widgetset</id>
<build>
<plugins>
<!-- Compile custom GWT components or widget dependencies with the GWT compiler -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0</version>
<configuration>
<webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<runTarget>clean</runTarget>
<soyc>false</soyc>
</configuration>
<executions>
<execution>
<goals>
<goal>resources</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>update-widgetset</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<!-- Activiti -->
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-explorer</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-modeler</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-diagram-rest</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-simple-workflow</artifactId>
</dependency>
<!-- Database -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<!-- Running example processes -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</dependency>
<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- Vaadin addons -->
<!-- Must be defined both in activiti-explorer and activiti-webapp-explorer, as otherwise the gwt compiler won't find it -->
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>dcharts-widget</artifactId>
<version>0.10.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>buzzmedia</id>
<url>http://maven.thebuzzmedia.com</url> <!-- ImageScalr -->
</repository>
<repository>
<id>Alfresco thirdparty</id>
<url>https://maven.alfresco.com/nexus/content/repositories/thirdparty/</url>
</repository>
</repositories>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
<inherits name="org.dussan.vaadin.dcharts.DchartsWidgetset" />
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="activiti-report">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="activiti-report">
<process id="task-duration-report" name="Task duration report" isExecutable="true">
<startEvent id="startevent1" name="Start">
<extensionElements>
<activiti:formProperty id="processDefinitionId" name="Select process definition" type="processDefinition" required="true" />
</extensionElements>
</startEvent>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="generateDataset" />
<scriptTask id="generateDataset" name="Execute script" scriptFormat="JavaScript" activiti:autoStoreVariables="false">
<process id="task-duration-report" name="Task duration report" isExecutable="true">
<startEvent id="startevent1" name="Start">
<extensionElements>
<activiti:formProperty id="processDefinition" name="Select process definition" type="processDefinition" required="true" />
<activiti:formProperty id="chartType" name="Chart type" type="enum" required="true">
<activiti:value id="pieChart" name="Pie chart" />
<activiti:value id="barChart" name="Bar chart" />
</activiti:formProperty>
</extensionElements>
</startEvent>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="generateDataset" />
<scriptTask id="generateDataset" name="Execute script" scriptFormat="JavaScript" activiti:autoStoreVariables="false">
<script><![CDATA[
importPackage(java.sql);
importPackage(java.lang);
importPackage(org.activiti.util);
importPackage(org.activiti.explorer.reporting);
var processDefinitionId = execution.getVariable("processDefinitionId");
var processDefinition = execution.getEngineServices().getRepositoryService().createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
var processDefinition = execution.getVariable("processDefinition");
var connection = AmazingUtil.getCurrentDatabaseConnection();
var select = connection.createStatement();
var result = select.executeQuery("SELECT NAME_, avg(DURATION_) from ACT_HI_TASKINST WHERE PROC_DEF_ID_ = '" + processDefinitionId + "' GROUP BY NAME_");
var result = ReportingUtil.executeSelectSqlQuery("select NAME_, avg(DURATION_) from ACT_HI_TASKINST where PROC_DEF_ID_ = '" + processDefinition.getId() + "' and END_TIME_ is not null group by NAME_");
var reportData = {};
reportData.type = "barChart";
reportData.type = String(execution.getVariable("chartType"));
reportData.description = "Average task duration for process definition '" + processDefinition.getName() + "' (version " + processDefinition.getVersion() + ")";
reportData.data = {};
while (result.next()) { // process results one row at a time
var name = result.getString(1);
var val = result.getLong(2);
var val = result.getLong(2) / 1000;
reportData.data[name] = val;
}
// Limitation! Cannot store / retrieve native json variables over multiple steps! TODO: discuss!
execution.setVariable("reportData", reportData);
// We want to store the results as bytes as the string size is limited in the variables table
execution.setVariable("reportData", new java.lang.String(JSON.stringify(reportData)).getBytes("UTF-8"));
]]></script>
</scriptTask>
<sequenceFlow id="flow3" sourceRef="generateDataset" targetRef="theEnd" />
<endEvent id="theEnd" />
</process>
<endEvent id="theEnd" />
</process>
</definitions>
\ No newline at end of file
/**
* Copyright (C) 2012-2013 Dušan Vejnovič <vaadin@dussan.org>
*
* 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.
*/
.v-dcharts {
color: #000000;
background-color: transparent;
cursor: default;
overflow: hidden;
font-size: 1.2em;
}
.v-dcharts .title {
font-size: 12px;
}
\ No newline at end of file
/**
* Copyright (C) 2012-2013 Dušan Vejnovič <vaadin@dussan.org>
*
* 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.
*/
.v-dcharts {
color: #000000;
background-color: transparent;
cursor: default;
overflow: hidden;
font-size: 1.2em;
}
\ No newline at end of file
<html>
<head><script>
var $wnd = parent;
var $doc = $wnd.document;
var $moduleName, $moduleBase, $entry
,$stats = $wnd.__gwtStatsEvent ? function(a) {return $wnd.__gwtStatsEvent(a);} : null
,$sessionId = $wnd.__gwtStatsSessionId ? $wnd.__gwtStatsSessionId : null;
// Lightweight metrics
if ($stats) {
var moduleFuncName = location.search.substr(1);
var moduleFunc = $wnd[moduleFuncName];
var moduleName = moduleFunc ? moduleFunc.moduleName : "unknown";
$stats({moduleName:moduleName,sessionId:$sessionId,subSystem:'startup',evtGroup:'moduleStartup',millis:(new Date()).getTime(),type:'moduleEvalStart'});
}
var $hostedHtmlVersion="2.1";
var gwtOnLoad;
var $hosted = "localhost:9997";
function loadIframe(url) {
var topDoc = window.top.document;
// create an iframe
var iframeDiv = topDoc.createElement("div");
iframeDiv.innerHTML = "<iframe scrolling=no frameborder=0 src='" + url + "'>";
var iframe = iframeDiv.firstChild;
// mess with the iframe style a little
var iframeStyle = iframe.style;
iframeStyle.position = "absolute";
iframeStyle.borderWidth = "0";
iframeStyle.left = "0";
iframeStyle.top = "0";
iframeStyle.width = "100%";
iframeStyle.backgroundColor = "#ffffff";
iframeStyle.zIndex = "1";
iframeStyle.height = "100%";
// update the top window's document's body's style
var hostBodyStyle = window.top.document.body.style;
hostBodyStyle.margin = "0";
hostBodyStyle.height = iframeStyle.height;
hostBodyStyle.overflow = "hidden";
// insert the iframe
topDoc.body.insertBefore(iframe, topDoc.body.firstChild);
}
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("gecko") != -1) {
// install eval wrapper on FF to avoid EvalError problem
var __eval = window.eval;
window.eval = function(s) {
return __eval(s);
}
}
if (ua.indexOf("chrome") != -1) {
// work around __gwt_ObjectId appearing in JS objects
var hop = Object.prototype.hasOwnProperty;
Object.prototype.hasOwnProperty = function(prop) {
return prop != "__gwt_ObjectId" && hop.call(this, prop);
};
// do the same in our parent as well -- see issue 4486
// NOTE: this will have to be changed when we support non-iframe-based DevMode
var hop2 = parent.Object.prototype.hasOwnProperty;
parent.Object.prototype.hasOwnProperty = function(prop) {
return prop != "__gwt_ObjectId" && hop2.call(this, prop);
};
}
// wrapper to call JS methods, which we need both to be able to supply a
// different this for method lookup and to get the exception back
function __gwt_jsInvoke(thisObj, methodName) {
try {
var args = Array.prototype.slice.call(arguments, 2);
return [0, window[methodName].apply(thisObj, args)];
} catch (e) {
return [1, e];
}
}
var __gwt_javaInvokes = [];
function __gwt_makeJavaInvoke(argCount) {
return __gwt_javaInvokes[argCount] || __gwt_doMakeJavaInvoke(argCount);
}
function __gwt_doMakeJavaInvoke(argCount) {
// IE6 won't eval() anonymous functions except as r-values
var argList = "";
for (var i = 0; i < argCount; i++) {
argList += ",p" + i;
}
var argListNoComma = argList.substring(1);
return eval(
"__gwt_javaInvokes[" + argCount + "] =\n" +
" function(thisObj, dispId" + argList + ") {\n" +
" var result = __static(dispId, thisObj" + argList + ");\n" +
" if (result[0]) {\n" +
" throw result[1];\n" +
" } else {\n" +
" return result[1];\n" +
" }\n" +
" }\n"
);
}
/*
* This is used to create tear-offs of Java methods. Each function corresponds
* to exactly one dispId, and also embeds the argument count. We get the "this"
* value from the context in which the function is being executed.
* Function-object identity is preserved by caching in a sparse array.
*/
var __gwt_tearOffs = [];
var __gwt_tearOffGenerators = [];
function __gwt_makeTearOff(proxy, dispId, argCount) {
return __gwt_tearOffs[dispId] || __gwt_doMakeTearOff(dispId, argCount);
}
function __gwt_doMakeTearOff(dispId, argCount) {
return __gwt_tearOffs[dispId] =
(__gwt_tearOffGenerators[argCount] || __gwt_doMakeTearOffGenerator(argCount))(dispId);
}
function __gwt_doMakeTearOffGenerator(argCount) {
// IE6 won't eval() anonymous functions except as r-values
var argList = "";
for (var i = 0; i < argCount; i++) {
argList += ",p" + i;
}
var argListNoComma = argList.substring(1);
return eval(
"__gwt_tearOffGenerators[" + argCount + "] =\n" +
" function(dispId) {\n" +
" return function(" + argListNoComma + ") {\n" +
" var result = __static(dispId, this" + argList + ");\n" +
" if (result[0]) {\n" +
" throw result[1];\n" +
" } else {\n" +
" return result[1];\n" +
" }\n" +
" }\n" +
" }\n"
);
}
function __gwt_makeResult(isException, result) {
return [isException, result];
}
function __gwt_disconnected() {
// Prevent double-invocation.
window.__gwt_disconnected = new Function();
// Do it in a timeout so we can be sure we have a clean stack.
window.setTimeout(__gwt_disconnected_impl, 1);
}
function __gwt_disconnected_impl() {
__gwt_displayGlassMessage('GWT Code Server Disconnected',
'Most likely, you closed GWT Development Mode. Or, you might have lost '
+ 'network connectivity. To fix this, try restarting GWT Development Mode and '
+ '<a style="color: #FFFFFF; font-weight: bold;" href="javascript:location.reload()">'
+ 'REFRESH</a> this page.');
}
// Keep track of z-index to allow layering of multiple glass messages
var __gwt_glassMessageZIndex = 2147483647;
// Note this method is also used by ModuleSpace.java
function __gwt_displayGlassMessage(summary, details) {
var topWin = window.top;
var topDoc = topWin.document;
var outer = topDoc.createElement("div");
// Do not insert whitespace or outer.firstChild will get a text node.
outer.innerHTML =
'<div style="position:absolute;z-index:' + __gwt_glassMessageZIndex-- +
';left:50px;top:50px;width:600px;color:#FFF;font-family:verdana;text-align:left;">' +
'<div style="font-size:30px;font-weight:bold;">' + summary + '</div>' +
'<div style="font-size:15px;">' + details + '</div>' +
'</div>' +
'<div style="position:absolute;z-index:' + __gwt_glassMessageZIndex-- +
';left:0px;top:0px;right:0px;bottom:0px;filter:alpha(opacity=60);opacity:0.6;background-color:#000;"></div>'
;
topDoc.body.appendChild(outer);
var glass = outer.firstChild;
var glassStyle = glass.style;
// Scroll to the top and remove scrollbars.
topWin.scrollTo(0, 0);
if (topDoc.compatMode == "BackCompat") {
topDoc.body.style["overflow"] = "hidden";
} else {
topDoc.documentElement.style["overflow"] = "hidden";
}
// Steal focus.
glass.focus();
if ((navigator.userAgent.indexOf("MSIE") >= 0) && (topDoc.compatMode == "BackCompat")) {
// IE quirks mode doesn't support right/bottom, but does support this.
glassStyle.width = "125%";
glassStyle.height = "100%";
} else if (navigator.userAgent.indexOf("MSIE 6") >= 0) {
// IE6 doesn't have a real standards mode, so we have to use hacks.
glassStyle.width = "125%"; // Get past scroll bar area.
// Nasty CSS; onresize would be better but the outer window won't let us add a listener IE.
glassStyle.setExpression("height", "document.documentElement.clientHeight");
}
$doc.title = summary + " [" + $doc.title + "]";
}
function findPluginObject() {
try {
return document.getElementById('pluginObject');
} catch (e) {
return null;
}
}
function findPluginEmbed() {
try {
return document.getElementById('pluginEmbed')
} catch (e) {
return null;
}
}
function findPluginXPCOM() {
try {
return __gwt_HostedModePlugin;
} catch (e) {
return null;
}
}
gwtOnLoad = function(errFn, modName, modBase){
$moduleName = modName;
$moduleBase = modBase;
// Note that the order is important
var pluginFinders = [
findPluginXPCOM,
findPluginObject,
findPluginEmbed,
];
var topWin = window.top;
var url = topWin.location.href;
if (!topWin.__gwt_SessionID) {
var ASCII_EXCLAMATION = 33;
var ASCII_TILDE = 126;
var chars = [];
for (var i = 0; i < 16; ++i) {
chars.push(Math.floor(ASCII_EXCLAMATION
+ Math.random() * (ASCII_TILDE - ASCII_EXCLAMATION + 1)));
}
topWin.__gwt_SessionID = String.fromCharCode.apply(null, chars);
}
var plugin = null;
for (var i = 0; i < pluginFinders.length; ++i) {
try {
var maybePlugin = pluginFinders[i]();
if (maybePlugin != null && maybePlugin.init(window)) {
plugin = maybePlugin;
break;
}
} catch (e) {
}
}
if (!plugin) {
// try searching for a v1 plugin for backwards compatibility
var found = false;
for (var i = 0; i < pluginFinders.length; ++i) {
try {
plugin = pluginFinders[i]();
if (plugin != null && plugin.connect($hosted, $moduleName, window)) {
return;
}
} catch (e) {
}
}
loadIframe("http://gwt.google.com/missing-plugin");
} else {
if (plugin.connect(url, topWin.__gwt_SessionID, $hosted, $moduleName,
$hostedHtmlVersion)) {
window.onUnload = function() {
try {
// wrap in try/catch since plugins are not required to supply this
plugin.disconnect();
} catch (e) {
}
};
} else {
if (errFn) {
errFn(modName);
} else {
alert("Plugin failed to connect to Development Mode server at " + $hosted);
loadIframe("http://code.google.com/p/google-web-toolkit/wiki/TroubleshootingOOPHM");
}
}
}
}
window.onunload = function() {
};
// Lightweight metrics
window.fireOnModuleLoadStart = function(className) {
$stats && $stats({moduleName:$moduleName, sessionId:$sessionId, subSystem:'startup', evtGroup:'moduleStartup', millis:(new Date()).getTime(), type:'onModuleLoadStart', className:className});
};
window.__gwt_module_id = 0;
</script></head>
<body>
<font face='arial' size='-1'>This html file is for Development Mode support.</font>
<script><!--
// Lightweight metrics
$stats && $stats({moduleName:$moduleName, sessionId:$sessionId, subSystem:'startup', evtGroup:'moduleStartup', millis:(new Date()).getTime(), type:'moduleEvalEnd'});
// OOPHM currently only supports IFrameLinker
var query = parent.location.search;
if (!findPluginXPCOM()) {
document.write('<embed id="pluginEmbed" type="application/x-gwt-hosted-mode" width="10" height="10">');
document.write('</embed>');
document.write('<object id="pluginObject" CLASSID="CLSID:1D6156B6-002B-49E7-B5CA-C138FB843B4E">');
document.write('</object>');
}
// look for the old query parameter if we don't find the new one
var idx = query.indexOf("gwt.codesvr=");
if (idx >= 0) {
idx += 12; // "gwt.codesvr=".length() == 12
} else {
idx = query.indexOf("gwt.hosted=");
if (idx >= 0) {
idx += 11; // "gwt.hosted=".length() == 11
}
}
if (idx >= 0) {
var amp = query.indexOf("&", idx);
if (amp >= 0) {
$hosted = query.substring(idx, amp);
} else {
$hosted = query.substring(idx);
}
// According to RFC 3986, some of this component's characters (e.g., ':')
// are reserved and *may* be escaped.
$hosted = decodeURIComponent($hosted);
}
query = window.location.search.substring(1);
if (query && $wnd[query]) setTimeout($wnd[query].onScriptLoad, 1);
--></script></body></html>
function org_activiti_explorer_CustomWidgetset(){var O='',vb='" for "gwt:onLoadErrorFn"',tb='" for "gwt:onPropertyErrorFn"',hb='"><\/script>',Y='#',Vb='.cache.html',$='/',Ob='2BADF336E827CE547D0FEF5C74C2A013',Pb='419702D66820E68BE89501603AAB106F',Qb='5B54A23C6184FE8742EF42E2474A2CE5',Rb='8C1AF52665FB58E2F0925361E8CDE162',Ub=':',nb='::',bc='<script defer="defer">org_activiti_explorer_CustomWidgetset.onInjectionDone(\'org.activiti.explorer.CustomWidgetset\')<\/script>',gb='<script id="',qb='=',Z='?',sb='Bad handler "',Sb='D391FCC6F662E7CD49FB7E5D0ABAF41D',ac='DOMContentLoaded',Tb='F6EDA597217FB283EE695EFC6E2195F3',ib='SCRIPT',fb='__gwt_marker_org.activiti.explorer.CustomWidgetset',jb='base',bb='baseUrl',S='begin',R='bootstrap',ab='clear.cache.gif',pb='content',Wb='dcharts/styles.css',X='end',Ib='gecko',Jb='gecko1_8',T='gwt.codesvr=',U='gwt.hosted=',V='gwt.hybrid',ub='gwt:onLoadErrorFn',rb='gwt:onPropertyErrorFn',ob='gwt:property',_b='head',Mb='hosted.html?org_activiti_explorer_CustomWidgetset',$b='href',Hb='ie6',Gb='ie8',Fb='ie9',wb='iframe',_='img',xb="javascript:''",Xb='link',Lb='loadExternalRefs',kb='meta',zb='moduleRequested',W='moduleStartup',Eb='msie',lb='name',Bb='opera',P='org.activiti.explorer.CustomWidgetset',db='org.activiti.explorer.CustomWidgetset.nocache.js',mb='org.activiti.explorer.CustomWidgetset::',yb='position:absolute;width:0;height:0;border:none',Yb='rel',Db='safari',cb='script',Nb='selectingPermutation',Q='startup',Zb='stylesheet',eb='undefined',Kb='unknown',Ab='user.agent',Cb='webkit';var l=window,m=document,n=l.__gwtStatsEvent?function(a){return l.__gwtStatsEvent(a)}:null,o=l.__gwtStatsSessionId?l.__gwtStatsSessionId:null,p,q,r,s=O,t={},u=[],v=[],w=[],x=0,y,z;n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:S});if(!l.__gwt_stylesLoaded){l.__gwt_stylesLoaded={}}if(!l.__gwt_scriptsLoaded){l.__gwt_scriptsLoaded={}}function A(){var b=false;try{var c=l.location.search;return (c.indexOf(T)!=-1||(c.indexOf(U)!=-1||l.external&&l.external.gwtOnLoad))&&c.indexOf(V)==-1}catch(a){}A=function(){return b};return b}
function B(){if(p&&q){var b=m.getElementById(P);var c=b.contentWindow;if(A()){c.__gwt_getProperty=function(a){return G(a)}}org_activiti_explorer_CustomWidgetset=null;c.gwtOnLoad(y,P,s,x);n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:W,millis:(new Date).getTime(),type:X})}}
function C(){function e(a){var b=a.lastIndexOf(Y);if(b==-1){b=a.length}var c=a.indexOf(Z);if(c==-1){c=a.length}var d=a.lastIndexOf($,Math.min(c,b));return d>=0?a.substring(0,d+1):O}
function f(a){if(a.match(/^\w+:\/\//)){}else{var b=m.createElement(_);b.src=a+ab;a=e(b.src)}return a}
function g(){var a=E(bb);if(a!=null){return a}return O}
function h(){var a=m.getElementsByTagName(cb);for(var b=0;b<a.length;++b){if(a[b].src.indexOf(db)!=-1){return e(a[b].src)}}return O}
function i(){var a;if(typeof isBodyLoaded==eb||!isBodyLoaded()){var b=fb;var c;m.write(gb+b+hb);c=m.getElementById(b);a=c&&c.previousSibling;while(a&&a.tagName!=ib){a=a.previousSibling}if(c){c.parentNode.removeChild(c)}if(a&&a.src){return e(a.src)}}return O}
function j(){var a=m.getElementsByTagName(jb);if(a.length>0){return a[a.length-1].href}return O}
var k=g();if(k==O){k=h()}if(k==O){k=i()}if(k==O){k=j()}if(k==O){k=e(m.location.href)}k=f(k);s=k;return k}
function D(){var b=document.getElementsByTagName(kb);for(var c=0,d=b.length;c<d;++c){var e=b[c],f=e.getAttribute(lb),g;if(f){f=f.replace(mb,O);if(f.indexOf(nb)>=0){continue}if(f==ob){g=e.getAttribute(pb);if(g){var h,i=g.indexOf(qb);if(i>=0){f=g.substring(0,i);h=g.substring(i+1)}else{f=g;h=O}t[f]=h}}else if(f==rb){g=e.getAttribute(pb);if(g){try{z=eval(g)}catch(a){alert(sb+g+tb)}}}else if(f==ub){g=e.getAttribute(pb);if(g){try{y=eval(g)}catch(a){alert(sb+g+vb)}}}}}}
function E(a){var b=t[a];return b==null?null:b}
function F(a,b){var c=w;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b}
function G(a){var b=v[a](),c=u[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(z){z(a,d,b)}throw null}
var H;function I(){if(!H){H=true;var a=m.createElement(wb);a.src=xb;a.id=P;a.style.cssText=yb;a.tabIndex=-1;m.body.appendChild(a);n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:W,millis:(new Date).getTime(),type:zb});a.contentWindow.location.replace(s+K)}}
v[Ab]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(function(){return b.indexOf(Bb)!=-1}())return Bb;if(function(){return b.indexOf(Cb)!=-1}())return Db;if(function(){return b.indexOf(Eb)!=-1&&m.documentMode>=9}())return Fb;if(function(){return b.indexOf(Eb)!=-1&&m.documentMode>=8}())return Gb;if(function(){var a=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(a&&a.length==3)return c(a)>=6000}())return Hb;if(function(){return b.indexOf(Ib)!=-1}())return Jb;return Kb};u[Ab]={gecko1_8:0,ie6:1,ie8:2,ie9:3,opera:4,safari:5};org_activiti_explorer_CustomWidgetset.onScriptLoad=function(){if(H){q=true;B()}};org_activiti_explorer_CustomWidgetset.onInjectionDone=function(){p=true;n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:Lb,millis:(new Date).getTime(),type:X});B()};D();C();var J;var K;if(A()){if(l.external&&(l.external.initModule&&l.external.initModule(P))){l.location.reload();return}K=Mb;J=O}n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:Nb});if(!A()){try{F([Gb],Ob);F([Fb],Pb);F([Hb],Qb);F([Db],Rb);F([Bb],Sb);F([Jb],Tb);J=w[G(Ab)];var L=J.indexOf(Ub);if(L!=-1){x=Number(J.substring(L+1));J=J.substring(0,L)}K=J+Vb}catch(a){return}}var M;function N(){if(!r){r=true;if(!__gwt_stylesLoaded[Wb]){var a=m.createElement(Xb);__gwt_stylesLoaded[Wb]=a;a.setAttribute(Yb,Zb);a.setAttribute($b,s+Wb);m.getElementsByTagName(_b)[0].appendChild(a)}B();if(m.removeEventListener){m.removeEventListener(ac,N,false)}if(M){clearInterval(M)}}}
if(m.addEventListener){m.addEventListener(ac,function(){I();N()},false)}var M=setInterval(function(){if(/loaded|complete/.test(m.readyState)){I();N()}},50);n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:X});n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:Lb,millis:(new Date).getTime(),type:S});m.write(bc)}
org_activiti_explorer_CustomWidgetset();
\ No newline at end of file
......@@ -20,20 +20,24 @@
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<filter>
<filter-name>UIFilter</filter-name>
<filter-class>org.activiti.explorer.filter.ExplorerFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>UIFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>UIFilter</filter-name>
<filter-class>org.activiti.explorer.filter.ExplorerFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>UIFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>Vaadin Application Servlet</servlet-name>
<servlet-class>org.activiti.explorer.servlet.ExplorerApplicationServlet</servlet-class>
<init-param>
<param-name>widgetset</param-name>
<param-value>org.activiti.explorer.CustomWidgetset</param-value>
</init-param>
</servlet>
<!-- Restlet adapter, used to expose modeler functionality through REST -->
......@@ -51,11 +55,11 @@
<servlet-name>Vaadin Application Servlet</servlet-name>
<url-pattern>/ui/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Vaadin Application Servlet</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Vaadin Application Servlet</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
<!-- Catch all service requests -->
<servlet-mapping>
......
router.attach("/process-instance/{processInstanceId}/highlights", ProcessInstanceHighLightsResource.class);
router.attach("/process-instance/{processInstanceId}/diagram-layout", ProcessDefinitionDiagramLayoutResource.class);
router.attach("/process-definition/{processDefinitionId}/diagram-layout", ProcessDefinitionDiagramLayoutResource.class);
\ 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.engine.impl.bpmn.behavior;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.delegate.BpmnError;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.impl.bpmn.helper.ErrorPropagation;
import org.activiti.engine.impl.bpmn.helper.ScopeUtil;
import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.delegate.ExecutionListenerInvocation;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.pvm.delegate.ActivityBehavior;
import org.activiti.engine.impl.pvm.delegate.ActivityExecution;
import org.activiti.engine.impl.pvm.delegate.CompositeActivityBehavior;
import org.activiti.engine.impl.pvm.delegate.SubProcessActivityBehavior;
import org.activiti.engine.impl.pvm.process.ActivityImpl;
/**
* Implementation of the multi-instance functionality as described in the BPMN 2.0 spec.
*
* Multi instance functionality is implemented as an {@link ActivityBehavior} that
* wraps the original {@link ActivityBehavior} of the activity.
*
* Only subclasses of {@link AbstractBpmnActivityBehavior} can have multi-instance
* behavior. As such, special logic is contained in the {@link AbstractBpmnActivityBehavior}
* to delegate to the {@link MultiInstanceActivityBehavior} if needed.
*
* @author Joram Barrez
* @author Falko Menge
*/
public abstract class MultiInstanceActivityBehavior extends FlowNodeActivityBehavior
implements CompositeActivityBehavior, SubProcessActivityBehavior {
protected static final Logger LOGGER = Logger.getLogger(MultiInstanceActivityBehavior.class.getName());
// Variable names for outer instance(as described in spec)
protected final String NUMBER_OF_INSTANCES = "nrOfInstances";
protected final String NUMBER_OF_ACTIVE_INSTANCES = "nrOfActiveInstances";
protected final String NUMBER_OF_COMPLETED_INSTANCES = "nrOfCompletedInstances";
// Variable names for inner instances (as described in the spec)
protected final String LOOP_COUNTER = "loopCounter";
// Instance members
protected ActivityImpl activity;
protected AbstractBpmnActivityBehavior innerActivityBehavior;
protected Expression loopCardinalityExpression;
protected Expression completionConditionExpression;
protected Expression collectionExpression;
protected String collectionVariable;
protected String collectionElementVariable;
/**
* @param innerActivityBehavior The original {@link ActivityBehavior} of the activity
* that will be wrapped inside this behavior.
* @param isSequential Indicates whether the multi instance behavior
* must be sequential or parallel
*/
public MultiInstanceActivityBehavior(ActivityImpl activity, AbstractBpmnActivityBehavior innerActivityBehavior) {
this.activity = activity;
setInnerActivityBehavior(innerActivityBehavior);
}
public void execute(ActivityExecution execution) throws Exception {
if (getLoopVariable(execution, LOOP_COUNTER) == null) {
try {
createInstances(execution);
} catch (BpmnError error) {
ErrorPropagation.propagateError(error, execution);
}
} else {
innerActivityBehavior.execute(execution);
}
}
protected abstract void createInstances(ActivityExecution execution) throws Exception;
// Intercepts signals, and delegates it to the wrapped {@link ActivityBehavior}.
public void signal(ActivityExecution execution, String signalName, Object signalData) throws Exception {
innerActivityBehavior.signal(execution, signalName, signalData);
}
// required for supporting embedded subprocesses
public void lastExecutionEnded(ActivityExecution execution) {
ScopeUtil.createEventScopeExecution((ExecutionEntity) execution);
leave(execution);
}
// required for supporting external subprocesses
public void completing(DelegateExecution execution, DelegateExecution subProcessInstance) throws Exception {
}
// required for supporting external subprocesses
public void completed(ActivityExecution execution) throws Exception {
leave(execution);
}
// Helpers //////////////////////////////////////////////////////////////////////
@SuppressWarnings("rawtypes")
protected int resolveNrOfInstances(ActivityExecution execution) {
int nrOfInstances = -1;
if (loopCardinalityExpression != null) {
nrOfInstances = resolveLoopCardinality(execution);
} else if (collectionExpression != null) {
Object obj = collectionExpression.getValue(execution);
if (!(obj instanceof Collection)) {
throw new ActivitiException(collectionExpression.getExpressionText()+"' didn't resolve to a Collection");
}
nrOfInstances = ((Collection) obj).size();
} else if (collectionVariable != null) {
Object obj = execution.getVariable(collectionVariable);
if (!(obj instanceof Collection)) {
throw new ActivitiException("Variable " + collectionVariable+"' is not a Collection");
}
nrOfInstances = ((Collection) obj).size();
} else {
throw new ActivitiException("Couldn't resolve collection expression nor variable reference");
}
return nrOfInstances;
}
@SuppressWarnings("rawtypes")
protected void executeOriginalBehavior(ActivityExecution execution, int loopCounter) throws Exception {
if (usesCollection() && collectionElementVariable != null) {
Collection collection = null;
if (collectionExpression != null) {
collection = (Collection) collectionExpression.getValue(execution);
} else if (collectionVariable != null) {
collection = (Collection) execution.getVariable(collectionVariable);
}
Object value = null;
int index = 0;
Iterator it = collection.iterator();
while (index <= loopCounter) {
value = it.next();
index++;
}
setLoopVariable(execution, collectionElementVariable, value);
}
// If loopcounter == 1, then historic activity instance already created, no need to
// pass through executeActivity again since it will create a new historic activity
if (loopCounter == 0) {
innerActivityBehavior.execute(execution);
} else {
execution.executeActivity(activity);
}
}
protected boolean usesCollection() {
return collectionExpression != null
|| collectionVariable != null;
}
protected boolean isExtraScopeNeeded() {
// special care is needed when the behavior is an embedded subprocess (not very clean, but it works)
return innerActivityBehavior instanceof org.activiti.engine.impl.bpmn.behavior.SubProcessActivityBehavior;
}
protected int resolveLoopCardinality(ActivityExecution execution) {
// Using Number since expr can evaluate to eg. Long (which is also the default for Juel)
Object value = loopCardinalityExpression.getValue(execution);
if (value instanceof Number) {
return ((Number) value).intValue();
} else if (value instanceof String) {
return Integer.valueOf((String) value);
} else {
throw new ActivitiException("Could not resolve loopCardinality expression '"
+loopCardinalityExpression.getExpressionText()+"': not a number nor number String");
}
}
protected boolean completionConditionSatisfied(ActivityExecution execution) {
if (completionConditionExpression != null) {
Object value = completionConditionExpression.getValue(execution);
if (! (value instanceof Boolean)) {
throw new ActivitiException("completionCondition '"
+ completionConditionExpression.getExpressionText()
+ "' does not evaluate to a boolean value");
}
Boolean booleanValue = (Boolean) value;
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Completion condition of multi-instance satisfied: " + booleanValue);
}
return booleanValue;
}
return false;
}
protected void setLoopVariable(ActivityExecution execution, String variableName, Object value) {
execution.setVariableLocal(variableName, value);
}
protected Integer getLoopVariable(ActivityExecution execution, String variableName) {
Object value = execution.getVariableLocal(variableName);
ActivityExecution parent = execution.getParent();
while (value == null && parent != null) {
value = parent.getVariableLocal(variableName);
parent = parent.getParent();
}
return (Integer) value;
}
/**
* Since no transitions are followed when leaving the inner activity,
* it is needed to call the end listeners yourself.
*/
protected void callActivityEndListeners(ActivityExecution execution) {
// TODO: This is currently done without a proper {@link AtomicOperation} causing problems, see http://jira.codehaus.org/browse/ACT-1339
List<ExecutionListener> listeners = activity.getExecutionListeners(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END);
for (ExecutionListener executionListener : listeners) {
try {
Context.getProcessEngineConfiguration()
.getDelegateInterceptor()
.handleInvocation(new ExecutionListenerInvocation(executionListener, execution));
} catch (Exception e) {
throw new ActivitiException("Couldn't execute end listener", e);
}
}
}
protected void logLoopDetails(ActivityExecution execution, String custom, int loopCounter,
int nrOfCompletedInstances, int nrOfActiveInstances, int nrOfInstances) {
if (LOGGER.isLoggable(Level.FINE)) {
StringBuilder strb = new StringBuilder();
strb.append("Multi-instance '" + execution.getActivity() + "' " + custom + ". ");
strb.append("Details: loopCounter=" + loopCounter + ", ");
strb.append("nrOrCompletedInstances=" + nrOfCompletedInstances + ", ");
strb.append("nrOfActiveInstances=" + nrOfActiveInstances+ ", ");
strb.append("nrOfInstances=" + nrOfInstances);
LOGGER.fine(strb.toString());
}
}
// Getters and Setters ///////////////////////////////////////////////////////////
public Expression getLoopCardinalityExpression() {
return loopCardinalityExpression;
}
public void setLoopCardinalityExpression(Expression loopCardinalityExpression) {
this.loopCardinalityExpression = loopCardinalityExpression;
}
public Expression getCompletionConditionExpression() {
return completionConditionExpression;
}
public void setCompletionConditionExpression(Expression completionConditionExpression) {
this.completionConditionExpression = completionConditionExpression;
}
public Expression getCollectionExpression() {
return collectionExpression;
}
public void setCollectionExpression(Expression collectionExpression) {
this.collectionExpression = collectionExpression;
}
public String getCollectionVariable() {
return collectionVariable;
}
public void setCollectionVariable(String collectionVariable) {
this.collectionVariable = collectionVariable;
}
public String getCollectionElementVariable() {
return collectionElementVariable;
}
public void setCollectionElementVariable(String collectionElementVariable) {
this.collectionElementVariable = collectionElementVariable;
}
public void setInnerActivityBehavior(AbstractBpmnActivityBehavior innerActivityBehavior) {
this.innerActivityBehavior = innerActivityBehavior;
this.innerActivityBehavior.setMultiInstanceActivityBehavior(this);
}
public AbstractBpmnActivityBehavior getInnerActivityBehavior() {
return this.innerActivityBehavior;
}
}
package org.activiti.rest.api.process;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.impl.RepositoryServiceImpl;
import org.activiti.engine.impl.TaskQueryProperty;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.activiti.engine.impl.pvm.PvmTransition;
import org.activiti.engine.impl.pvm.process.ActivityImpl;
import org.activiti.engine.query.QueryProperty;
import org.activiti.engine.runtime.Execution;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.TaskQuery;
import org.activiti.rest.api.ActivitiUtil;
import org.activiti.rest.api.DataResponse;
import org.activiti.rest.api.SecuredResource;
import org.activiti.rest.api.task.TasksPaginateList;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.node.ArrayNode;
import org.codehaus.jackson.node.ObjectNode;
import org.restlet.resource.Get;
public class ProcessInstanceHighLightsResource extends SecuredResource {
private RuntimeService runtimeService = ActivitiUtil.getRuntimeService();
private RepositoryServiceImpl repositoryService = (RepositoryServiceImpl) ActivitiUtil.getRepositoryService();
private HistoryService historyService = (HistoryService) ActivitiUtil.getHistoryService();
private ProcessInstance processInstance;
private ProcessDefinitionEntity processDefinition;
List<String> historicActivityInstanceList = new ArrayList<String>();
List<String> highLightedFlows = new ArrayList<String>();
public ProcessInstanceHighLightsResource() {
/*
properties.put("id", TaskQueryProperty.TASK_ID);
properties.put("executionId", TaskQueryProperty.EXECUTION_ID);
properties.put("processInstanceId", TaskQueryProperty.PROCESS_INSTANCE_ID);
*/
}
@Get
public ObjectNode getHighlighted() {
if (authenticate() == false)
return null;
String processInstanceId = (String) getRequest().getAttributes().get("processInstanceId");
if (processInstanceId == null) {
throw new ActivitiException("No process instance id provided");
}
ObjectNode responseJSON = new ObjectMapper().createObjectNode();
responseJSON.put("processInstanceId", processInstanceId);
ArrayNode activitiesArray = new ObjectMapper().createArrayNode();
ArrayNode flowsArray = new ObjectMapper().createArrayNode();
try {
processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
processDefinition = (ProcessDefinitionEntity) repositoryService
.getDeployedProcessDefinition(processInstance.getProcessDefinitionId());
responseJSON.put("processDefinitionId", processInstance.getProcessDefinitionId());
List<String> highLightedActivities = runtimeService.getActiveActivityIds(processInstanceId);
List<String> highLightedFlows = getHighLightedFlows(processDefinition, processInstanceId);
for (String activityId : highLightedActivities)
activitiesArray.add(activityId);
for (String flow : highLightedFlows)
flowsArray.add(flow);
for (String activityId : highLightedActivities) {
Execution execution = runtimeService.createExecutionQuery()
.processInstanceId(processInstance.getProcessInstanceId())
.activityId(activityId).singleResult();
ExecutionEntity executionEntity = (ExecutionEntity)execution;
executionEntity.getProcessDefinitionId();
}
} catch (Exception e) {}
responseJSON.put("activities", activitiesArray);
responseJSON.put("flows", flowsArray);
return responseJSON;
}
// TODO: move this method to some 'utils'
private List<String> getHighLightedFlows(ProcessDefinitionEntity processDefinition, String processInstanceId) {
List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).orderByHistoricActivityInstanceStartTime().asc()/*.orderByActivityId().asc()*/.list();
//_log.info("--->procId: " + procId);
for (HistoricActivityInstance hai : historicActivityInstances) {
//_log.info("id: " + hai.getId() + ", ActivityId:" + hai.getActivityId() + ", ActivityName:" + hai.getActivityName());
historicActivityInstanceList.add(hai.getActivityId());
}
// add current activities to list
List<String> highLightedActivities = runtimeService.getActiveActivityIds(processInstanceId);
historicActivityInstanceList.addAll(highLightedActivities);
// activities and their sequence-flows
getHighLightedFlows(processDefinition.getActivities());
return highLightedFlows;
}
private void getHighLightedFlows (List<ActivityImpl> activityList) {
for (ActivityImpl activity : activityList) {
//int index = historicActivityInstanceList.indexOf(activity.getId());
if (activity.getProperty("type").equals("subProcess")) {
// get flows for the subProcess
getHighLightedFlows(activity.getActivities());
}
//if (index >=0 && index+1 < historicActivityInstanceList.size()) {
if (historicActivityInstanceList.contains(activity.getId())) {
//_log.info("* actId:" + activity.getId() + ", transitions: " + activity.getOutgoingTransitions());
List<PvmTransition> pvmTransitionList = activity.getOutgoingTransitions();
for (PvmTransition pvmTransition: pvmTransitionList) {
String destinationFlowId = pvmTransition.getDestination().getId();
//_log.info("- destinationFlowId: " + destinationFlowId + ", + " + historicActivityInstanceList.get(index+1));
if (historicActivityInstanceList.contains(destinationFlowId)) {
//_log.info("> actId:" + activity.getId() + ", flow: " + destinationFlowId);
highLightedFlows.add(pvmTransition.getId());
}
}
}
}
}
}
/* 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.engine.impl.jobexecutor;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.delegate.VariableScope;
import org.activiti.engine.impl.calendar.BusinessCalendar;
import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.el.StartProcessVariableScope;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.persistence.entity.TimerEntity;
import org.activiti.engine.impl.util.ClockUtil;
/**
* @author Tom Baeyens
*/
public class TimerDeclarationImpl implements Serializable {
private static final long serialVersionUID = 1L;
protected Expression description;
protected TimerDeclarationType type;
protected String jobHandlerType;
protected String jobHandlerConfiguration = null;
protected String repeat;
protected boolean exclusive = TimerEntity.DEFAULT_EXCLUSIVE;
protected int retries = TimerEntity.DEFAULT_RETRIES;
protected boolean isInterruptingTimer; // For boundary timers
public TimerDeclarationImpl(Expression expression, TimerDeclarationType type, String jobHandlerType) {
this.jobHandlerType = jobHandlerType;
this.description = expression;
this.type= type;
}
public String getDescription() {
return description.getExpressionText();
}
public String getJobHandlerType() {
return jobHandlerType;
}
public String getJobHandlerConfiguration() {
return jobHandlerConfiguration;
}
public void setJobHandlerConfiguration(String jobHandlerConfiguration) {
this.jobHandlerConfiguration = jobHandlerConfiguration;
}
public String getRepeat() {
return repeat;
}
public void setRepeat(String repeat) {
this.repeat = repeat;
}
public boolean isExclusive() {
return exclusive;
}
public void setExclusive(boolean exclusive) {
this.exclusive = exclusive;
}
public int getRetries() {
return retries;
}
public void setRetries(int retries) {
this.retries = retries;
}
public void setJobHandlerType(String jobHandlerType) {
this.jobHandlerType = jobHandlerType;
}
public boolean isInterruptingTimer() {
return isInterruptingTimer;
}
public void setInterruptingTimer(boolean isInterruptingTimer) {
this.isInterruptingTimer = isInterruptingTimer;
}
public TimerEntity prepareTimerEntity(ExecutionEntity executionEntity) {
BusinessCalendar businessCalendar = Context
.getProcessEngineConfiguration()
.getBusinessCalendarManager()
.getBusinessCalendar(type.calendarName);
if (description==null) {
// Prevent NPE from happening in the next line
throw new ActivitiException("Timer '"+executionEntity.getActivityId()+"' was not configured with a valid duration/time");
}
String dueDateString = null;
Date duedate = null;
// ACT-1415: timer-declaration on start-event may contain expressions NOT
// evaluating variables but other context, evaluating should happen nevertheless
VariableScope scopeForExpression = executionEntity;
if(scopeForExpression == null) {
scopeForExpression = StartProcessVariableScope.getSharedInstance();
}
Object dueDateValue = description.getValue(scopeForExpression);
if (dueDateValue instanceof String) {
dueDateString = (String)dueDateValue;
}
else if (dueDateValue instanceof Date) {
duedate = (Date)dueDateValue;
}
else {
throw new ActivitiException("Timer '"+executionEntity.getActivityId()+"' was not configured with a valid duration/time, either hand in a java.util.Date or a String in format 'yyyy-MM-dd'T'hh:mm:ss'");
}
if (duedate==null) {
duedate = businessCalendar.resolveDuedate(dueDateString);
}
TimerEntity timer = new TimerEntity(this);
timer.setDuedate(duedate);
if (executionEntity != null) {
timer.setExecution(executionEntity);
}
if (type == TimerDeclarationType.CYCLE) {
// See ACT-1427: A boundary timer with a cancelActivity='true', doesn't need to repeat itself
if (!isInterruptingTimer) {
String prepared = prepareRepeat(dueDateString);
timer.setRepeat(prepared);
}
}
return timer;
}
private String prepareRepeat(String dueDate) {
if (dueDate.startsWith("R") && dueDate.split("/").length==2) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
return dueDate.replace("/","/"+sdf.format(ClockUtil.getCurrentTime())+"/");
}
return dueDate;
}
}
<?
$id = $_REQUEST["id"];
if (isset($id)) {
$id = str_replace(":", "-", $id);
if (isset($_REQUEST["callback"])) {
echo $_REQUEST["callback"]."(";
include("./process-definition/$id.json");
echo ")";
} else {
include("./process-definition/$id.json");
}
}
?>
\ No newline at end of file
{
"processDefinition": {
"id": "sendSMSProcess:2:2361",
"category": "http://www.activiti.org/test",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/common/SendSMSProcess.sendSMSProcess.png",
"name": "Send SMS Process",
"startFormResourceKey": null,
"javaClass": "org.activiti.rest.api.process.ProcessDefinitionResponse",
"deploymentId": "2332",
"graphicNotationDefined": true,
"key": "sendSMSProcess",
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/common/SendSMSProcess.bpmn",
"version": 2
},
"activities": [{
"activityId": "startevent1",
"properties": {
"name": "Start",
"line": 14,
"type": "startEvent"
},
"x": 40,
"y": 107,
"width": 35,
"height": 35
},
{
"activityId": "sendSMSCheckDeliverySubprocess",
"properties": {
"triggeredByEvent": false,
"initial": "startevent2",
"name": "Send SMS Check Delivery",
"line": 15,
"timerDeclarations": [{
"isExclusive": true,
"retries": "3",
"type": "timer-transition",
"configuration": "boundarytimer_SEND_SMS_TIMEOUT",
"expression": "P2D"
}],
"errorEventDefinitions": [{
"errorCode": "sendFailed",
"handlerActivityId": "boundaryerror_SEND_FAILED"
}],
"multiInstance": "sequential",
"type": "subProcess",
"isExpanded": true,
"eventDefinitions": [{
"activityId": "boundarysignal1",
"eventName": "interruptProcess",
"eventType": "signal",
"isAsync": false,
"isStartEvent": false
}]
},
"multiInstance": "sequential",
"nestedActivities": ["startevent2",
"servicetask_GET_STATUS",
"exclusivegateway2",
"timerintermediatecatchevent1",
"endevent5",
"endevent6",
"boundaryerror_SEND_FAILED",
"boundarytimer_SEND_SMS_TIMEOUT",
"boundarysignal1"],
"x": 49,
"y": 273,
"width": 492,
"height": 205
},
{
"activityId": "startevent2",
"properties": {
"name": "Start",
"line": 30,
"type": "startEvent"
},
"x": 80,
"y": 360,
"width": 35,
"height": 35
},
{
"activityId": "servicetask_GET_STATUS",
"properties": {
"name": "Get Message Status",
"line": 24,
"type": "serviceTask"
},
"x": 250,
"y": 332,
"width": 143,
"height": 91
},
{
"activityId": "exclusivegateway2",
"properties": {
"default": "flow9",
"name": "Exclusive Gateway",
"line": 25,
"type": "exclusiveGateway"
},
"x": 420,
"y": 357,
"width": 40,
"height": 40
},
{
"activityId": "timerintermediatecatchevent1",
"properties": {
"name": "TimerCatchEvent",
"line": 31,
"timerDeclarations": [{
"isExclusive": true,
"retries": "3",
"type": "timer-intermediate-transition",
"configuration": "timerintermediatecatchevent1",
"expression": "PT0M"
}],
"type": "intermediateTimer"
},
"x": 160,
"y": 360,
"width": 35,
"height": 35
},
{
"activityId": "endevent5",
"properties": {
"name": "End",
"line": 26,
"type": "endEvent"
},
"x": 490,
"y": 298,
"width": 35,
"height": 35
},
{
"activityId": "endevent6",
"properties": {
"name": "ErrorEnd",
"line": 27,
"type": "errorEndEvent"
},
"x": 490,
"y": 410,
"width": 35,
"height": 35
},
{
"activityId": "boundaryerror_SEND_FAILED",
"properties": {
"name": "Send Failed",
"line": 50,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 339,
"y": 462,
"width": 30,
"height": 30
},
{
"activityId": "boundarytimer_SEND_SMS_TIMEOUT",
"properties": {
"name": "SEND_SMS_TIMEOUT",
"line": 53,
"type": "boundaryTimer"
},
"isInterrupting": true,
"x": 197,
"y": 462,
"width": 30,
"height": 30
},
{
"activityId": "boundarysignal1",
"properties": {
"name": "",
"line": 58,
"type": "boundarySignal"
},
"isInterrupting": true,
"x": 477,
"y": 462,
"width": 30,
"height": 30
},
{
"activityId": "exclusivegateway1",
"properties": {
"default": "flow3_InvalidArguments",
"name": "Exclusive Gateway",
"line": 61,
"type": "exclusiveGateway"
},
"x": 169,
"y": 104,
"width": 40,
"height": 40
},
{
"activityId": "servicetask_SEND_SMS",
"properties": {
"name": "Send SMS",
"line": 75,
"type": "serviceTask"
},
"x": 137,
"y": 176,
"width": 105,
"height": 55
},
{
"activityId": "exclusivegateway3",
"properties": {
"default": "flow19_SendFailed",
"name": "Exclusive Gateway",
"line": 76,
"type": "exclusiveGateway"
},
"x": 274,
"y": 183,
"width": 40,
"height": 40
},
{
"activityId": "endErrorEvent_INVALID_ARGUMENTS",
"properties": {
"name": "ErrorEnd",
"line": 62,
"type": "errorEndEvent"
},
"x": 274,
"y": 39,
"width": 35,
"height": 35
},
{
"activityId": "endErrorEventInterrupted",
"properties": {
"name": "ErrorEndInterrupted",
"line": 65,
"type": "errorEndEvent"
},
"x": 474,
"y": 520,
"width": 35,
"height": 35
},
{
"activityId": "endErrorEvent_SEND_FAILED",
"properties": {
"name": "ErrorEnd",
"line": 68,
"type": "errorEndEvent"
},
"x": 336,
"y": 520,
"width": 35,
"height": 35
},
{
"activityId": "endevent4",
"properties": {
"name": "End",
"line": 71,
"type": "endEvent"
},
"x": 590,
"y": 358,
"width": 35,
"height": 35
},
{
"activityId": "endErrorEvent__SEND_SMS_TIMEOUT",
"properties": {
"name": "ErrorEnd",
"line": 72,
"type": "errorEndEvent"
},
"x": 194,
"y": 520,
"width": 35,
"height": 35
},
{
"activityId": "endevent7_sendFailed",
"properties": {
"name": "Send Failed ErrorEnd",
"line": 77,
"type": "errorEndEvent"
},
"x": 395,
"y": 124,
"width": 35,
"height": 35
}],
"sequenceFlows": [{
"id": "flow1",
"name": "Check Attributes",
"flow": "(startevent1)--flow1-->(exclusivegateway1)",
"xPointArray": [75,
169],
"yPointArray": [124,
124]
},
{
"id": "flow6",
"name": "",
"flow": "(sendSMSCheckDeliverySubprocess)--flow6-->(endevent4)",
"xPointArray": [541,
590],
"yPointArray": [375,
375]
},
{
"id": "flow19",
"name": "",
"flow": "(startevent2)--flow19-->(timerintermediatecatchevent1)",
"xPointArray": [115,
160],
"yPointArray": [377,
377]
},
{
"id": "flow17",
"name": "",
"flow": "(servicetask_GET_STATUS)--flow17-->(exclusivegateway2)",
"xPointArray": [393,
420],
"yPointArray": [377,
377]
},
{
"id": "flow9",
"name": "",
"flow": "(exclusivegateway2)--flow9-->(endevent5)",
"isDefault": true,
"xPointArray": [440,
439,
490],
"yPointArray": [357,
315,
315]
},
{
"id": "flow15_sendFailed",
"name": "Send Failed",
"flow": "(exclusivegateway2)--flow15_sendFailed-->(endevent6)",
"xPointArray": [440,
439,
490],
"yPointArray": [397,
427,
427]
},
{
"id": "flow20",
"name": "",
"flow": "(timerintermediatecatchevent1)--flow20-->(servicetask_GET_STATUS)",
"xPointArray": [195,
250],
"yPointArray": [377,
377]
},
{
"id": "flow5",
"name": "",
"flow": "(boundaryerror_SEND_FAILED)--flow5-->(endErrorEvent_SEND_FAILED)",
"xPointArray": [354,
353],
"yPointArray": [492,
520]
},
{
"id": "flow7",
"name": "",
"flow": "(boundarytimer_SEND_SMS_TIMEOUT)--flow7-->(endErrorEvent__SEND_SMS_TIMEOUT)",
"xPointArray": [212,
211],
"yPointArray": [492,
520]
},
{
"id": "flow13",
"name": "",
"flow": "(boundarysignal1)--flow13-->(endErrorEventInterrupted)",
"xPointArray": [492,
491],
"yPointArray": [492,
520]
},
{
"id": "flow2",
"name": "",
"flow": "(exclusivegateway1)--flow2-->(servicetask_SEND_SMS)",
"xPointArray": [189,
189,
189],
"yPointArray": [144,
169,
176]
},
{
"id": "flow3_InvalidArguments",
"name": "Invalid Arguments",
"flow": "(exclusivegateway1)--flow3_InvalidArguments-->(endErrorEvent_INVALID_ARGUMENTS)",
"isDefault": true,
"xPointArray": [189,
189,
274],
"yPointArray": [104,
56,
56]
},
{
"id": "flow16",
"name": "",
"flow": "(servicetask_SEND_SMS)--flow16-->(exclusivegateway3)",
"xPointArray": [242,
274],
"yPointArray": [203,
203]
},
{
"id": "flow18",
"name": "",
"flow": "(exclusivegateway3)--flow18-->(sendSMSCheckDeliverySubprocess)",
"xPointArray": [294,
295],
"yPointArray": [223,
273]
},
{
"id": "flow19_SendFailed",
"name": "Send Failed",
"flow": "(exclusivegateway3)--flow19_SendFailed-->(endevent7_sendFailed)",
"isDefault": true,
"xPointArray": [294,
294,
395],
"yPointArray": [183,
141,
141]
}]
}
\ No newline at end of file
{
"processDefinition": {
"id": "sendSerialSMSProcess:2:2365",
"category": "http://www.activiti.org/test",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/common/SendSerialSMSProcess.sendSerialSMSProcess.png",
"name": "Send Serial SMS",
"startFormResourceKey": null,
"javaClass": "org.activiti.rest.api.process.ProcessDefinitionResponse",
"deploymentId": "2332",
"graphicNotationDefined": true,
"key": "sendSerialSMSProcess",
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/common/SendSerialSMSProcess.bpmn",
"version": 2
},
"activities": [{
"activityId": "startevent1",
"properties": {
"name": "Start",
"line": 14,
"type": "startEvent"
},
"x": 136,
"y": 275,
"width": 35,
"height": 35
},
{
"activityId": "subprocess1_sendSerialSMS",
"properties": {
"triggeredByEvent": false,
"initial": "timerstartevent1_sendSMSElement",
"name": "Send Serial SMS Subprocess",
"line": 15,
"errorEventDefinitions": [{
"errorCode": "timeout",
"handlerActivityId": "boundaryerror1_timeout"
},
{
"errorCode": "sendFailed",
"handlerActivityId": "boundaryerror2_sendFailed"
},
{
"errorCode": "interrupted",
"handlerActivityId": "boundaryerror3_interrupted"
},
{
"errorCode": "invalidArguments",
"handlerActivityId": "boundaryerror4_invalidArguments"
}],
"multiInstance": "sequential",
"type": "subProcess",
"isExpanded": true
},
"multiInstance": "sequential",
"nestedActivities": ["timerstartevent1_sendSMSElement",
"callactivity3_SendSMS",
"endevent2",
"boundaryerror1_timeout",
"boundaryerror2_sendFailed",
"boundaryerror3_interrupted",
"boundaryerror4_invalidArguments"],
"x": 300,
"y": 190,
"width": 471,
"height": 205
},
{
"activityId": "timerstartevent1_sendSMSElement",
"properties": {
"name": "Timer sendSMS start",
"line": 21,
"type": "startEvent"
},
"x": 330,
"y": 277,
"width": 35,
"height": 35
},
{
"activityId": "callactivity3_SendSMS",
"properties": {
"name": "Send SMS",
"line": 26,
"type": "callActivity",
"processDefinitonKey": "sendSMSProcess",
"processDefinitons": [{
"processDefinitionId": "sendSMSProcess:2:2361",
"processDefinitionKey": "sendSMSProcess",
"processDefinitionName": "Send SMS Process"
}]
},
"collapsed": true,
"x": 450,
"y": 267,
"width": 105,
"height": 55
},
{
"activityId": "endevent2",
"properties": {
"name": "End",
"line": 32,
"type": "endEvent"
},
"x": 610,
"y": 277,
"width": 35,
"height": 35
},
{
"activityId": "boundaryerror1_timeout",
"properties": {
"name": "Delivery Timeout",
"line": 36,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 640,
"y": 360,
"width": 30,
"height": 30
},
{
"activityId": "boundaryerror2_sendFailed",
"properties": {
"name": "Send Failed",
"line": 39,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 560,
"y": 360,
"width": 30,
"height": 30
},
{
"activityId": "boundaryerror3_interrupted",
"properties": {
"name": "Interrupted",
"line": 42,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 410,
"y": 360,
"width": 30,
"height": 30
},
{
"activityId": "boundaryerror4_invalidArguments",
"properties": {
"name": "Invalid Arguments",
"line": 45,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 333,
"y": 360,
"width": 30,
"height": 30
},
{
"activityId": "exclusivegateway1",
"properties": {
"name": "Exclusive Gateway",
"line": 51,
"type": "exclusiveGateway"
},
"x": 450,
"y": 470,
"width": 40,
"height": 40
},
{
"activityId": "exclusivegateway2",
"properties": {
"default": "flow11_invalidArguments",
"name": "Exclusive Gateway",
"line": 53,
"type": "exclusiveGateway"
},
"x": 193,
"y": 272,
"width": 40,
"height": 40
},
{
"activityId": "endErrorEvent2_smsSendError",
"properties": {
"name": "SMS Send Error End",
"line": 48,
"type": "errorEndEvent"
},
"x": 453,
"y": 540,
"width": 35,
"height": 35
},
{
"activityId": "endevent3",
"properties": {
"name": "End",
"line": 52,
"type": "endEvent"
},
"x": 830,
"y": 275,
"width": 35,
"height": 35
},
{
"activityId": "endevent4_invalidArguments",
"properties": {
"name": "Invalid Arguments",
"line": 54,
"type": "errorEndEvent"
},
"x": 310,
"y": 110,
"width": 35,
"height": 35
}],
"sequenceFlows": [{
"id": "flow3",
"name": "",
"flow": "(startevent1)--flow3-->(exclusivegateway2)",
"xPointArray": [171,
193],
"yPointArray": [292,
292]
},
{
"id": "flow9",
"name": "",
"flow": "(subprocess1_sendSerialSMS)--flow9-->(endevent3)",
"xPointArray": [771,
783,
830],
"yPointArray": [292,
292,
292]
},
{
"id": "flow6",
"name": "",
"flow": "(timerstartevent1_sendSMSElement)--flow6-->(callactivity3_SendSMS)",
"xPointArray": [365,
450],
"yPointArray": [294,
294]
},
{
"id": "flow8",
"name": "",
"flow": "(callactivity3_SendSMS)--flow8-->(endevent2)",
"xPointArray": [555,
610],
"yPointArray": [294,
294]
},
{
"id": "flow8_timeout",
"name": "Delivery Timeout",
"flow": "(boundaryerror1_timeout)--flow8_timeout-->(exclusivegateway1)",
"xPointArray": [655,
654,
490],
"yPointArray": [390,
489,
490]
},
{
"id": "flow8_sendFailed",
"name": "Send Failed",
"flow": "(boundaryerror2_sendFailed)--flow8_sendFailed-->(exclusivegateway1)",
"xPointArray": [575,
470],
"yPointArray": [390,
470]
},
{
"id": "flow8_interrupted",
"name": "Interrupted",
"flow": "(boundaryerror3_interrupted)--flow8_interrupted-->(exclusivegateway1)",
"xPointArray": [425,
470],
"yPointArray": [390,
470]
},
{
"id": "flow8_invalidArguments",
"name": "Invalid Arguments",
"flow": "(boundaryerror4_invalidArguments)--flow8_invalidArguments-->(exclusivegateway1)",
"xPointArray": [348,
347,
450],
"yPointArray": [390,
491,
490]
},
{
"id": "flow7_smsError",
"name": "SMS Error / smsSendError",
"flow": "(exclusivegateway1)--flow7_smsError-->(endErrorEvent2_smsSendError)",
"xPointArray": [470,
470],
"yPointArray": [510,
540]
},
{
"id": "flow11_invalidArguments",
"name": "invalidArguments",
"flow": "(exclusivegateway2)--flow11_invalidArguments-->(endevent4_invalidArguments)",
"isDefault": true,
"xPointArray": [213,
213,
310],
"yPointArray": [272,
127,
127]
},
{
"id": "flow10",
"name": "",
"flow": "(exclusivegateway2)--flow10-->(subprocess1_sendSerialSMS)",
"xPointArray": [233,
300],
"yPointArray": [292,
292]
}]
}
\ No newline at end of file
{
"processDefinition": {
"id": "sendSimpleSMSProcess:2:2372",
"category": "http://www.activiti.org/test",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/common/SendSimpleSMSProcess.sendSimpleSMSProcess.png",
"name": "ПРОСТАЯ ОТПРАВКА SMS",
"startFormResourceKey": null,
"javaClass": "org.activiti.rest.api.process.ProcessDefinitionResponse",
"deploymentId": "2332",
"graphicNotationDefined": false,
"key": "sendSimpleSMSProcess",
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/common/SendSimpleSMSProcess.bpmn",
"version": 2
},
"activities": [{
"activityId": "startevent1",
"properties": {
"name": "Start",
"line": 4,
"type": "startEvent"
},
"x": 160,
"y": 200,
"width": 35,
"height": 35
},
{
"activityId": "sendSMS_Boundary_callactivity",
"properties": {
"name": "SEND SMS",
"line": 5,
"errorEventDefinitions": [{
"errorCode": "interrupted",
"handlerActivityId": "boundaryerror1_interrupted"
},
{
"errorCode": "invalidArguments",
"handlerActivityId": "boundaryerror2_invalidArguments"
},
{
"errorCode": "sendFailed",
"handlerActivityId": "boundaryerror3_sendFailed"
},
{
"errorCode": "timeout",
"handlerActivityId": "boundaryerror4_timeout"
}],
"type": "callActivity",
"processDefinitonKey": "sendSMSProcess",
"processDefinitons": [{
"processDefinitionId": "sendSMSProcess:2:2361",
"processDefinitionKey": "sendSMSProcess",
"processDefinitionName": "Send SMS Process"
}]
},
"collapsed": true,
"nestedActivities": ["boundaryerror1_interrupted",
"boundaryerror2_invalidArguments",
"boundaryerror3_sendFailed",
"boundaryerror4_timeout"],
"x": 270,
"y": 157,
"width": 221,
"height": 121
},
{
"activityId": "boundaryerror1_interrupted",
"properties": {
"name": "boundaryerror1_interrupted",
"line": 11,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 280,
"y": 260,
"width": 30,
"height": 30
},
{
"activityId": "boundaryerror2_invalidArguments",
"properties": {
"name": "boundaryerror2_invalidArguments",
"line": 14,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 320,
"y": 260,
"width": 30,
"height": 30
},
{
"activityId": "boundaryerror3_sendFailed",
"properties": {
"name": "boundaryerror3_sendFailed",
"line": 17,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 400,
"y": 260,
"width": 30,
"height": 30
},
{
"activityId": "boundaryerror4_timeout",
"properties": {
"name": "boundaryerror4_timeout",
"line": 20,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 450,
"y": 260,
"width": 30,
"height": 30
},
{
"activityId": "exclusivegateway1",
"properties": {
"name": "Exclusive Gateway",
"line": 24,
"type": "exclusiveGateway"
},
"x": 360,
"y": 330,
"width": 40,
"height": 40
},
{
"activityId": "endevent2",
"properties": {
"name": "End",
"line": 23,
"type": "endEvent"
},
"x": 570,
"y": 200,
"width": 35,
"height": 35
},
{
"activityId": "endevent3",
"properties": {
"name": "ErrorEnd",
"line": 25,
"type": "errorEndEvent"
},
"x": 363,
"y": 400,
"width": 35,
"height": 35
}],
"sequenceFlows": [{
"id": "flow1",
"name": "",
"flow": "(startevent1)--flow1-->(sendSMS_Boundary_callactivity)",
"xPointArray": [195,
270],
"yPointArray": [217,
217]
},
{
"id": "flow3",
"name": "",
"flow": "(sendSMS_Boundary_callactivity)--flow3-->(endevent2)",
"xPointArray": [491,
570],
"yPointArray": [217,
217]
},
{
"id": "flow7",
"name": "",
"flow": "(boundaryerror1_interrupted)--flow7-->(exclusivegateway1)",
"xPointArray": [295,
294,
360],
"yPointArray": [290,
349,
350]
},
{
"id": "flow6",
"name": "",
"flow": "(boundaryerror2_invalidArguments)--flow6-->(exclusivegateway1)",
"xPointArray": [335,
380],
"yPointArray": [290,
330]
},
{
"id": "flow4",
"name": "",
"flow": "(boundaryerror3_sendFailed)--flow4-->(exclusivegateway1)",
"xPointArray": [415,
380],
"yPointArray": [290,
330]
},
{
"id": "flow5",
"name": "",
"flow": "(boundaryerror4_timeout)--flow5-->(exclusivegateway1)",
"xPointArray": [465,
464,
400],
"yPointArray": [290,
349,
350]
},
{
"id": "flow8",
"name": "",
"flow": "(exclusivegateway1)--flow8-->(endevent3)",
"xPointArray": [380,
380],
"yPointArray": [370,
400]
}]
}
\ No newline at end of file
{
"processDefinition": {
"id": "smsCollectionProcess:2:2367",
"category": "http://www.activiti.org/test",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/common/SMSCollectionProcess.smsCollectionProcess.png",
"name": "SMS ВЗЫСКАНИЕ",
"startFormResourceKey": null,
"javaClass": "org.activiti.rest.api.process.ProcessDefinitionResponse",
"deploymentId": "2332",
"graphicNotationDefined": false,
"key": "smsCollectionProcess",
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/common/SMSCollectionProcess.bpmn",
"version": 2
},
"activities": [{
"activityId": "startevent1",
"properties": {
"name": "Start",
"line": 9,
"type": "startEvent"
},
"x": 90,
"y": 262,
"width": 35,
"height": 35
},
{
"activityId": "exclusivegateway4",
"properties": {
"default": "flow13_invalidArguments",
"name": "Exclusive Gateway",
"line": 13,
"type": "exclusiveGateway"
},
"x": 180,
"y": 259,
"width": 40,
"height": 40
},
{
"activityId": "subprocess1_smsCollection",
"properties": {
"triggeredByEvent": false,
"initial": "startevent2",
"name": "МЕРОПРИЯТИЯ SMS ВЗЫСКАНИЕ",
"line": 17,
"errorEventDefinitions": [{
"errorCode": "SMSCollectionError",
"handlerActivityId": "boundaryerror3_smsSendErrorEnd"
}],
"type": "subProcess",
"isExpanded": true
},
"nestedActivities": ["startevent2",
"scripttask3_smsElementsHard",
"exclusivegateway1",
"scripttask2_smsElementsSoft",
"scripttask1_smsElementsDefault",
"sendSerialSMScallactivity",
"exclusivegateway5",
"exclusivegateway7",
"endevent1",
"endevent2_SMSCollectionError",
"boundaryerror3_smsSendErrorEnd"],
"x": 260,
"y": 94,
"width": 861,
"height": 371
},
{
"activityId": "startevent2",
"properties": {
"name": "Start",
"line": 73,
"type": "startEvent"
},
"x": 280,
"y": 174,
"width": 35,
"height": 35
},
{
"activityId": "scripttask3_smsElementsHard",
"properties": {
"name": "УСТАНОВИТЬ НАБОР SMS-СООБЩЕНИЙ ПО-УМОЛЧАНИЮ ДЛЯ HARD",
"line": 22,
"type": "scriptTask"
},
"x": 601,
"y": 344,
"width": 170,
"height": 81
},
{
"activityId": "exclusivegateway1",
"properties": {
"default": "flow2_DEFAULT",
"name": "Exclusive Gateway",
"line": 34,
"type": "exclusiveGateway"
},
"x": 491,
"y": 265,
"width": 40,
"height": 40
},
{
"activityId": "scripttask2_smsElementsSoft",
"properties": {
"name": "УСТАНОВИТЬ НАБОР SMS-СООБЩЕНИЙ ПО-УМОЛЧАНИЮ ДЛЯ SOFT",
"line": 36,
"type": "scriptTask"
},
"x": 610,
"y": 144,
"width": 171,
"height": 81
},
{
"activityId": "scripttask1_smsElementsDefault",
"properties": {
"name": "УСТАНОВИТЬ НАБОР SMS-СООБЩЕНИЙ ПО-УМОЛЧАНИЮ",
"line": 48,
"type": "scriptTask"
},
"x": 621,
"y": 243,
"width": 150,
"height": 81
},
{
"activityId": "sendSerialSMScallactivity",
"properties": {
"name": "СЕРИЙНАЯ ОТПРАВКА SMS",
"line": 60,
"errorEventDefinitions": [{
"errorCode": "smsSendError",
"handlerActivityId": "boundaryerror1_smsSendError"
},
{
"errorCode": "invalidArguments",
"handlerActivityId": "boundaryerror1_invalidArguments"
}],
"type": "callActivity",
"processDefinitonKey": "sendSerialSMSProcess",
"processDefinitons": [{
"processDefinitionId": "sendSerialSMSProcess:2:2365",
"processDefinitionKey": "sendSerialSMSProcess",
"processDefinitionName": "Send Serial SMS"
}]
},
"collapsed": true,
"nestedActivities": ["boundaryerror1_smsSendError",
"boundaryerror1_invalidArguments"],
"x": 881,
"y": 242,
"width": 144,
"height": 84
},
{
"activityId": "boundaryerror1_smsSendError",
"properties": {
"name": "SMS Send Error",
"line": 67,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 980,
"y": 310,
"width": 30,
"height": 30
},
{
"activityId": "boundaryerror1_invalidArguments",
"properties": {
"name": "Invalid Arguments",
"line": 70,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 900,
"y": 310,
"width": 30,
"height": 30
},
{
"activityId": "exclusivegateway5",
"properties": {
"name": "Exclusive Gateway",
"line": 74,
"type": "exclusiveGateway"
},
"x": 811,
"y": 263,
"width": 40,
"height": 40
},
{
"activityId": "exclusivegateway7",
"properties": {
"name": "Exclusive Gateway",
"line": 75,
"type": "exclusiveGateway"
},
"x": 932,
"y": 344,
"width": 40,
"height": 40
},
{
"activityId": "endevent1",
"properties": {
"name": "End",
"line": 35,
"type": "endEvent"
},
"x": 1060,
"y": 266,
"width": 35,
"height": 35
},
{
"activityId": "endevent2_SMSCollectionError",
"properties": {
"name": "Serial SMSCollectionError END",
"line": 76,
"type": "errorEndEvent"
},
"x": 935,
"y": 400,
"width": 35,
"height": 35
},
{
"activityId": "boundaryerror3_smsSendErrorEnd",
"properties": {
"name": "SMS Boundary ErrorEnd",
"line": 94,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 710,
"y": 450,
"width": 30,
"height": 30
},
{
"activityId": "endevent_smsSendErrorEnd",
"properties": {
"name": "SMS Send ErrorEnd",
"line": 10,
"type": "errorEndEvent"
},
"x": 707,
"y": 500,
"width": 35,
"height": 35
},
{
"activityId": "endevent2_invalidArguments",
"properties": {
"name": "Invalid Arguments Error End",
"line": 14,
"type": "errorEndEvent"
},
"x": 183,
"y": 181,
"width": 35,
"height": 35
},
{
"activityId": "endevent4",
"properties": {
"name": "End",
"line": 97,
"type": "endEvent"
},
"x": 850,
"y": 510,
"width": 35,
"height": 35
}],
"sequenceFlows": [{
"id": "flow22",
"name": "",
"flow": "(startevent1)--flow22-->(exclusivegateway4)",
"xPointArray": [125,
180],
"yPointArray": [279,
279]
},
{
"id": "flow12",
"name": "",
"flow": "(exclusivegateway4)--flow12-->(subprocess1_smsCollection)",
"xPointArray": [220,
260],
"yPointArray": [279,
279]
},
{
"id": "flow13_invalidArguments",
"name": "Invalid Arguments",
"flow": "(exclusivegateway4)--flow13_invalidArguments-->(endevent2_invalidArguments)",
"isDefault": true,
"xPointArray": [200,
200],
"yPointArray": [259,
216]
},
{
"id": "flow30",
"name": "",
"flow": "(subprocess1_smsCollection)--flow30-->(endevent4)",
"xPointArray": [690,
867],
"yPointArray": [465,
510]
},
{
"id": "flow23",
"name": "",
"flow": "(startevent2)--flow23-->(exclusivegateway1)",
"xPointArray": [297,
511],
"yPointArray": [209,
265]
},
{
"id": "flow18",
"name": "",
"flow": "(scripttask3_smsElementsHard)--flow18-->(exclusivegateway5)",
"xPointArray": [771,
831,
831],
"yPointArray": [384,
384,
303]
},
{
"id": "flow2_DEFAULT",
"name": "DEFAULT",
"flow": "(exclusivegateway1)--flow2_DEFAULT-->(scripttask1_smsElementsDefault)",
"isDefault": true,
"xPointArray": [531,
621],
"yPointArray": [285,
283]
},
{
"id": "flow3_SOFT",
"name": "SOFT",
"flow": "(exclusivegateway1)--flow3_SOFT-->(scripttask2_smsElementsSoft)",
"xPointArray": [511,
510,
610],
"yPointArray": [265,
184,
184]
},
{
"id": "flow4_HARD",
"name": "HARD",
"flow": "(exclusivegateway1)--flow4_HARD-->(scripttask3_smsElementsHard)",
"xPointArray": [511,
510,
601],
"yPointArray": [305,
384,
384]
},
{
"id": "flow16",
"name": "",
"flow": "(scripttask2_smsElementsSoft)--flow16-->(exclusivegateway5)",
"xPointArray": [781,
831,
831],
"yPointArray": [184,
184,
263]
},
{
"id": "flow17",
"name": "",
"flow": "(scripttask1_smsElementsDefault)--flow17-->(exclusivegateway5)",
"xPointArray": [771,
811],
"yPointArray": [283,
283]
},
{
"id": "flow15",
"name": "",
"flow": "(sendSerialSMScallactivity)--flow15-->(endevent1)",
"xPointArray": [1025,
1060],
"yPointArray": [284,
283]
},
{
"id": "flow27",
"name": "ОШИБКА ОТПРАВКИ",
"flow": "(boundaryerror1_smsSendError)--flow27-->(exclusivegateway7)",
"xPointArray": [995,
993,
972],
"yPointArray": [340,
365,
364]
},
{
"id": "flow26",
"name": "Invalid Arguments",
"flow": "(boundaryerror1_invalidArguments)--flow26-->(exclusivegateway7)",
"xPointArray": [915,
914,
932],
"yPointArray": [340,
364,
364]
},
{
"id": "flow19",
"name": "",
"flow": "(exclusivegateway5)--flow19-->(sendSerialSMScallactivity)",
"xPointArray": [851,
881],
"yPointArray": [283,
284]
},
{
"id": "flow28",
"name": "",
"flow": "(exclusivegateway7)--flow28-->(endevent2_SMSCollectionError)",
"xPointArray": [952,
952],
"yPointArray": [384,
400]
},
{
"id": "flow29",
"name": "",
"flow": "(boundaryerror3_smsSendErrorEnd)--flow29-->(endevent_smsSendErrorEnd)",
"xPointArray": [725,
724],
"yPointArray": [480,
500]
}]
}
\ No newline at end of file
{
"processDefinition": {
"id": "techCollectionProcess:2:2368",
"category": "http://www.activiti.org/test",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/TechCollectionProcess.techCollectionProcess.png",
"name": "ТЕХНОЛОГИЧЕСКОЕ СОПРОВОЖДЕНИЕ",
"startFormResourceKey": null,
"javaClass": "org.activiti.rest.api.process.ProcessDefinitionResponse",
"deploymentId": "2332",
"graphicNotationDefined": false,
"key": "techCollectionProcess",
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/TechCollectionProcess.bpmn",
"version": 2
},
"activities": [{
"activityId": "startevent1",
"properties": {
"name": "Start",
"line": 11,
"type": "startEvent"
},
"x": 40,
"y": 300,
"width": 35,
"height": 35
},
{
"activityId": "eventgateway1",
"properties": {
"name": "Event Gateway",
"line": 12,
"timerDeclarations": [{
"isExclusive": true,
"retries": "3",
"type": "timer-intermediate-transition",
"configuration": "timerintermediatecatchevent1",
"expression": "PT35M"
}],
"type": "eventBasedGateway",
"eventDefinitions": [{
"activityId": "SignalCatch_NewLoan",
"eventName": "newLoan",
"eventType": "signal",
"isAsync": false,
"isStartEvent": false
},
{
"activityId": "SignalCatch_NewPayment",
"eventName": "newPayment",
"eventType": "signal",
"isAsync": false,
"isStartEvent": false
}]
},
"nestedActivities": ["SignalCatch_NewLoan",
"SignalCatch_NewPayment",
"timerintermediatecatchevent1"],
"x": 107,
"y": 297,
"width": 40,
"height": 40
},
{
"activityId": "SignalCatch_NewLoan",
"properties": {
"name": "SignalCatch_NewLoan",
"line": 13,
"type": "intermediateSignalCatch"
},
"x": 190,
"y": 110,
"width": 35,
"height": 35
},
{
"activityId": "SignalCatch_NewPayment",
"properties": {
"name": "SignalCatch_NewPayment",
"line": 16,
"type": "intermediateSignalCatch"
},
"x": 190,
"y": 390,
"width": 35,
"height": 35
},
{
"activityId": "timerintermediatecatchevent1",
"properties": {
"name": "TimerCatchEvent",
"line": 52,
"type": "intermediateTimer"
},
"x": 181,
"y": 300,
"width": 35,
"height": 35
},
{
"activityId": "paymentReceived_sendSMS_CallActivity",
"properties": {
"name": "SEND SMS: PAYMENT RECEIVED",
"line": 19,
"errorEventDefinitions": [{
"errorCode": "sendSMSError",
"handlerActivityId": "sendFailedBoundaryError2"
}],
"type": "callActivity",
"processDefinitonKey": "sendSimpleSMSProcess",
"processDefinitons": [{
"processDefinitionId": "sendSimpleSMSProcess:2:2372",
"processDefinitionKey": "sendSimpleSMSProcess",
"processDefinitionName": "ПРОСТАЯ ОТПРАВКА SMS"
}]
},
"collapsed": true,
"nestedActivities": ["sendFailedBoundaryError2"],
"x": 320,
"y": 350,
"width": 231,
"height": 115
},
{
"activityId": "sendFailedBoundaryError2",
"properties": {
"name": "SEND SMS ERROR",
"line": 25,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 510,
"y": 430,
"width": 30,
"height": 30
},
{
"activityId": "parallelgateway1",
"properties": {
"name": "Parallel Gateway",
"line": 29,
"type": "parallelGateway"
},
"x": 262,
"y": 107,
"width": 40,
"height": 40
},
{
"activityId": "mailtask1",
"properties": {
"name": "SEND MAIL: NEW LOAN NOTIFICATION",
"line": 30,
"type": "serviceTask"
},
"x": 320,
"y": 33,
"width": 231,
"height": 115
},
{
"activityId": "newCreditor_sendSMS_CallActivity",
"properties": {
"name": "SEND SMS: NEW LOAN NOTIFICATION",
"line": 39,
"errorEventDefinitions": [{
"errorCode": "sendSMSError",
"handlerActivityId": "sendFailedBoundaryError1"
}],
"type": "callActivity",
"processDefinitonKey": "sendSimpleSMSProcess",
"processDefinitons": [{
"processDefinitionId": "sendSimpleSMSProcess:2:2372",
"processDefinitionKey": "sendSimpleSMSProcess",
"processDefinitionName": "ПРОСТАЯ ОТПРАВКА SMS"
}]
},
"collapsed": true,
"nestedActivities": ["sendFailedBoundaryError1"],
"x": 320,
"y": 173,
"width": 231,
"height": 115
},
{
"activityId": "sendFailedBoundaryError1",
"properties": {
"name": "SEND SMS ERROR",
"line": 45,
"type": "boundaryError"
},
"isInterrupting": true,
"x": 510,
"y": 256,
"width": 30,
"height": 30
},
{
"activityId": "parallelgateway2",
"properties": {
"name": "Parallel Gateway",
"line": 48,
"type": "parallelGateway"
},
"x": 645,
"y": 133,
"width": 40,
"height": 40
},
{
"activityId": "endevent1",
"properties": {
"name": "End",
"line": 28,
"type": "endEvent"
},
"x": 685,
"y": 390,
"width": 35,
"height": 35
},
{
"activityId": "endevent2",
"properties": {
"name": "End",
"line": 49,
"type": "endEvent"
},
"x": 719,
"y": 136,
"width": 35,
"height": 35
},
{
"activityId": "endevent3",
"properties": {
"name": "End",
"line": 50,
"type": "endEvent"
},
"x": 685,
"y": 316,
"width": 35,
"height": 35
},
{
"activityId": "endevent4",
"properties": {
"name": "End",
"line": 51,
"type": "endEvent"
},
"x": 685,
"y": 480,
"width": 35,
"height": 35
},
{
"activityId": "endevent5",
"properties": {
"name": "End",
"line": 57,
"type": "endEvent"
},
"x": 246,
"y": 300,
"width": 35,
"height": 35
}],
"sequenceFlows": [{
"id": "flow3",
"name": "",
"flow": "(startevent1)--flow3-->(eventgateway1)",
"xPointArray": [75,
107],
"yPointArray": [317,
317]
},
{
"id": "flow1",
"name": "",
"flow": "(eventgateway1)--flow1-->(SignalCatch_NewLoan)",
"xPointArray": [127,
127,
190],
"yPointArray": [297,
127,
127]
},
{
"id": "flow2",
"name": "",
"flow": "(eventgateway1)--flow2-->(SignalCatch_NewPayment)",
"xPointArray": [127,
127,
190],
"yPointArray": [337,
407,
407]
},
{
"id": "flow16",
"name": "",
"flow": "(eventgateway1)--flow16-->(timerintermediatecatchevent1)",
"xPointArray": [147,
181],
"yPointArray": [317,
317]
},
{
"id": "newLoanFlow",
"name": "НОВАЯ ССУДА",
"flow": "(SignalCatch_NewLoan)--newLoanFlow-->(parallelgateway1)",
"xPointArray": [225,
262],
"yPointArray": [127,
127]
},
{
"id": "newPaymentFlow",
"name": "НОВЫЙ ПЛАТЕЖ",
"flow": "(SignalCatch_NewPayment)--newPaymentFlow-->(paymentReceived_sendSMS_CallActivity)",
"xPointArray": [225,
320],
"yPointArray": [407,
407]
},
{
"id": "flow15",
"name": "",
"flow": "(timerintermediatecatchevent1)--flow15-->(endevent5)",
"xPointArray": [216,
246],
"yPointArray": [317,
317]
},
{
"id": "flow5",
"name": "",
"flow": "(paymentReceived_sendSMS_CallActivity)--flow5-->(endevent1)",
"xPointArray": [551,
685],
"yPointArray": [407,
407]
},
{
"id": "flow13",
"name": "",
"flow": "(sendFailedBoundaryError2)--flow13-->(endevent4)",
"xPointArray": [525,
524,
685],
"yPointArray": [460,
497,
497]
},
{
"id": "flow7",
"name": "",
"flow": "(parallelgateway1)--flow7-->(parallelgateway2)",
"xPointArray": [282,
282,
665],
"yPointArray": [107,
76,
133]
},
{
"id": "flow8",
"name": "",
"flow": "(parallelgateway1)--flow8-->(newCreditor_sendSMS_CallActivity)",
"xPointArray": [282,
282,
320],
"yPointArray": [147,
232,
230]
},
{
"id": "flow9",
"name": "",
"flow": "(mailtask1)--flow9-->(parallelgateway2)",
"xPointArray": [551,
664,
665],
"yPointArray": [90,
89,
133]
},
{
"id": "flow10",
"name": "",
"flow": "(newCreditor_sendSMS_CallActivity)--flow10-->(parallelgateway2)",
"xPointArray": [551,
664,
665],
"yPointArray": [230,
229,
173]
},
{
"id": "flow12",
"name": "",
"flow": "(sendFailedBoundaryError1)--flow12-->(endevent3)",
"xPointArray": [525,
524,
685],
"yPointArray": [286,
333,
333]
},
{
"id": "flow11",
"name": "",
"flow": "(parallelgateway2)--flow11-->(endevent2)",
"xPointArray": [685,
719],
"yPointArray": [153,
153]
}]
}
\ No newline at end of file
{
"name": "Send SMS Process",
"key": "sendSMSProcess",
"id": "sendSMSProcess:2:2361",
"version": 2,
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/common/SendSMSProcess.bpmn",
"category": "http://www.activiti.org/test",
"deploymentId": "2332",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/common/SendSMSProcess.sendSMSProcess.png",
"graphicNotationDefined": false,
"startFormResourceKey": null
}
\ No newline at end of file
{
"name": "Send Serial SMS",
"key": "sendSerialSMSProcess",
"id": "sendSerialSMSProcess:2:2365",
"version": 2,
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/common/SendSerialSMSProcess.bpmn",
"category": "http://www.activiti.org/test",
"deploymentId": "2332",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/common/SendSerialSMSProcess.sendSerialSMSProcess.png",
"graphicNotationDefined": false,
"startFormResourceKey": null
}
\ No newline at end of file
{
"name": " SMS",
"key": "sendSimpleSMSProcess",
"id": "sendSimpleSMSProcess:2:2372",
"version": 2,
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/common/SendSimpleSMSProcess.bpmn",
"category": "http://www.activiti.org/test",
"deploymentId": "2332",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/common/SendSimpleSMSProcess.sendSimpleSMSProcess.png",
"graphicNotationDefined": false,
"startFormResourceKey": null
}
\ No newline at end of file
{
"name": "SMS ",
"key": "smsCollectionProcess",
"id": "smsCollectionProcess:2:2367",
"version": 2,
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/common/SMSCollectionProcess.bpmn",
"category": "http://www.activiti.org/test",
"deploymentId": "2332",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/common/SMSCollectionProcess.smsCollectionProcess.png",
"graphicNotationDefined": false,
"startFormResourceKey": null
}
\ No newline at end of file
{
"name": "ТЕХНОЛОГИЧЕСКОЕ СОПРОВОЖДЕНИЕ",
"key": "techCollectionProcess",
"id": "techCollectionProcess:2:2368",
"version": 2,
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/TechCollectionProcess.bpmn",
"category": "http://www.activiti.org/test",
"deploymentId": "2332",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/TechCollectionProcess.techCollectionProcess.png",
"graphicNotationDefined": false,
"startFormResourceKey": null
}
\ No newline at end of file
{
"name": "ТЕХНОЛОГИЧЕСКОЕ СОПРОВОЖДЕНИЕ",
"key": "techCollectionProcess",
"id": "techCollectionProcess:2:2368",
"version": 2,
"resourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/TechCollectionProcess.bpmn",
"category": "http://www.activiti.org/test",
"deploymentId": "2332",
"diagramResourceName": "pkb-bpmn-models/src/main/resources/com/fsphere/bpmn20/diagrams/collection/TechCollectionProcess.techCollectionProcess.png",
"graphicNotationDefined": false,
"startFormResourceKey": null
}
\ No newline at end of file
<?
include("./process-definition/_process-definitions.json");
}
?>
\ No newline at end of file
<?
$id = $_REQUEST["id"];
if (isset($id)) {
$id = str_replace(":", "-", $id);
if (isset($_REQUEST["callback"])) {
echo $_REQUEST["callback"]."(";
include("./process-definition/diagram-layout/$id.json");
echo ")";
} else {
include("./process-definition/diagram-layout/$id.json");
}
}
?>
\ No newline at end of file
<?
$id = $_REQUEST["id"];
if (isset($id)) {
$id = str_replace(":", "-", $id);
if (isset($_REQUEST["callback"])) {
echo $_REQUEST["callback"]."(";
include("./processinstance-highlights/$id.json");
echo ")";
} else {
include("./processinstance-highlights/$id.json");
}
}
?>
\ No newline at end of file
{
"processInstanceId": "4400",
"processDefinitionId": "techCollectionProcess:2:2368",
"activities": [
"paymentReceived_sendSMS_CallActivity"
],
"flows": [
"flow3",
"flow2",
"newPaymentFlow"
]
}
\ No newline at end of file
{
"processInstanceId": "4401",
"processDefinitionId": "sendSimpleSMSProcess:2:2372",
"activities": [
"sendSMS_Boundary_callactivity"
],
"flows": [
"flow1"
]
}
\ No newline at end of file
......@@ -19,7 +19,7 @@ var ActivitiRest = {
}).done(function(data, textStatus) {
//console.log("ajax done");
}).fail(function(jqXHR, textStatus, error){
console.error('Get diagram layout['+processDefinitionKey+'] failure: ', textStatus, 'error: ', error, jqXHR);
//console.error('Get diagram layout['+processDefinitionKey+'] failure: ', textStatus, 'error: ', error, jqXHR);
});
},
......@@ -43,7 +43,7 @@ var ActivitiRest = {
}).done(function(data, textStatus) {
//console.log("ajax done");
}).fail(function(jqXHR, textStatus, error){
console.log('Get diagram layout['+processDefinitionId+'] failure: ', textStatus, jqXHR);
//console.log('Get diagram layout['+processDefinitionId+'] failure: ', textStatus, jqXHR);
});
},
......@@ -68,7 +68,7 @@ var ActivitiRest = {
}).done(function(data, textStatus) {
//console.log("ajax done");
}).fail(function(jqXHR, textStatus, error){
console.log('Get HighLights['+processInstanceId+'] failure: ', textStatus, jqXHR);
//console.log('Get HighLights['+processInstanceId+'] failure: ', textStatus, jqXHR);
});
},
};
\ No newline at end of file
cd ../modules/activiti-webapp-explorer2/
mvn -Pcompile-widgetset clean package
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册