提交 534614c4 编写于 作者: J Joram Barrez

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

......@@ -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));
}
}
/* 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.cmd;
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;
/**
* @author Tom Baeyens
*/
public class GetUserAccountCmd implements Command<Account>, Serializable {
private static final long serialVersionUID = 1L;
protected String userId;
protected String userPassword;
protected String accountName;
public GetUserAccountCmd(String userId, String userPassword, String accountName) {
this.userId = userId;
this.userPassword = userPassword;
this.accountName = accountName;
}
public Account execute(CommandContext commandContext) {
return commandContext
.getIdentityInfoEntityManager()
.findUserAccountByUserIdAndKey(userId, userPassword, accountName);
}
}
......@@ -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()
......
/* 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.identity;
import java.util.Map;
/**
* @author Tom Baeyens
*
* @deprecated Will be removed in Activiti 5.12
*/
public interface Account {
String NAME_ALFRESCO = "Alfresco";
String NAME_GOOGLE = "Google";
String NAME_SKYPE = "Skype";
String NAME_MAIL = "Mail";
String getName();
String getUsername();
String getPassword();
Map<String, String> getDetails();
}
......@@ -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() {
......
......@@ -7,6 +7,8 @@ confirmation.dialog.no= \u5426
button.ok = \u786e\u5b9a
button.create = \u521b\u5efa
button.cancel = \u53d6\u6d88
button.save = \u4fdd\u5b58
button.delete = \u5220\u9664
uncaught.exception = \u8b66\u544a
# Navigation
......@@ -199,6 +201,36 @@ process.suspend.popup.process.instances.description = \u540c\u65f6\u6302\u8d77\u
process.convert = \u8f6c\u6362\u4e3a\u53ef\u7f16\u8f91\u6a21\u578b
process.export = \u5bfc\u51fa\u6a21\u578b
process.toxml.failed = \u521b\u5efaBPMN\u6587\u4ef6\u5931\u8d25
process.editor.choice = \u9996\u9009\u8bbe\u8ba1\u5668:
process.editor.modeler = Activiti Modeler
process.editor.modeler.description = \u6210\u719f\u7684BPMN2.0\u56fe\u5f62\u5316\u5efa\u6a21\u73af\u5883\u3002\u9009\u62e9\u5b83\u53ef\u4ee5\u7528\u62d6\u62fd\u7684\u65b9\u5f0f\u4f7f\u7528Activiti\u652f\u6301\u7684\u7ec4\u4ef6\u3002
process.editor.conversion.warning.modeler = \u8b66\u544a\uff1a\u4e00\u65e6\u9009\u62e9\u4f7f\u7528Activiti Modeler\u7f16\u8f91\u6b64\u6a21\u578b\uff0c\u4e0b\u6b21\u7f16\u8f91\u65f6\u5c06\u4e0d\u518d\u4f7f\u7528\u8868\u683c\u5f0f\u8bbe\u8ba1\u5668\u6253\u5f00\u5b83\u3002
process.editor.table = \u8868\u683c\u5f0f\u8bbe\u8ba1\u5668
process.editor.table.description = \u4e00\u4e2a\u76f4\u89c2\u7684\u3001\u57fa\u4e8e\u8868\u683c\u6837\u5f0f\u7684\u7f16\u8f91\u5668\u3002\u4f7f\u7528\u5b83\u53ef\u4ee5\u5feb\u901f\u5f00\u53d1\u7b80\u5355\u6d41\u7a0b\u6216\u8005\u4f60\u4e0d\u719f\u6089BPMN2.0\u89c4\u8303\u3002
process.editor.create.new = \u521b\u5efa\u65b0\u6d41\u7a0b "{0}"
process.editor.create.new.default = \u521b\u5efa\u65b0\u6d41\u7a0b
process.editor.title = \u7f16\u8f91\u6a21\u5f0f
process.editor.name = \u540d\u79f0
process.editor.description = \u63cf\u8ff0
process.editor.tasks = \u4efb\u52a1\u5217\u8868
process.editor.bpmn.preview = \u9884\u89c8\u6d41\u7a0b\u56fe
process.editor.save = \u4fdd\u5b58
process.editor.property.name = \u540d\u79f0
process.editor.property.type = \u7c7b\u578b
process.editor.property.required = \u5fc5\u586b?
process.editor.task.name = \u4efb\u52a1\u540d\u79f0
process.editor.task.assignee = \u529e\u7406\u4eba
process.editor.task.groups = \u5019\u9009\u7ec4\uff08\u591a\u4e2a\u7528\u82f1\u6587\u9017\u53f7\u5206\u5272\uff09
process.editor.task.description = \u4efb\u52a1\u63cf\u8ff0
process.editor.task.concurrency = \u5e76\u884c
process.editor.task.startwithprevious = start with previous
process.editor.task.form.create = \u521b\u5efa\u8868\u5355
process.editor.task.form.edit = \u7f16\u8f91\u8868\u5355
process.editor.actions = \u64cd\u4f5c
process.editor.property.type.text = \u6587\u672c
process.editor.property.type.number = \u6570\u5b57
process.editor.property.type.date = \u65e5\u671f
process.editor.loading.error = \u52a0\u8f7d\u6d41\u7a0b\u5931\u8d25
process.instance.delete = \u5220\u9664
process.instance.delete.popup.title = \u5220\u9664\u6d41\u7a0b\u5b9e\u4f8b {0}?
process.instance.delete.popup.description = \u60a8\u786e\u5b9a\u8981\u5220\u9664\u6d41\u7a0b\u5b9e\u4f8b\u5417\uff1f<br/>\u6b64\u64cd\u4f5c\u4f1a\u5220\u9664\u548c\u6d41\u7a0b\u5b9e\u4f8b\u76f8\u5173\u7684\u4efb\u52a1\u548c\u6570\u636e\u3002
......@@ -229,6 +261,10 @@ process.delete.popup.caption = \u5220\u9664 {0}
process.delete.popup.message = \u60a8\u786e\u5b9a\u4ece\u5f53\u524d\u5de5\u4f5c\u533a\u5220\u9664\u6a21\u578b\u5417\uff1f
process.delete.popup.delete.button = \u5220\u9664
#Reporting menu
reporting.menu.run.reports = Run reports
reporting.menu.saved.reports = \u4fdd\u5b58\u7684\u62a5\u8868
# Management menu
management.menu.database = \u6570\u636e\u5e93
management.menu.deployments = \u90e8\u7f72\u5305
......
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
......@@ -48,14 +48,14 @@ $(document).ready(function(){
var processDefinitionId = query_string["processDefinitionId"];
var processInstanceId = query_string["processInstanceId"];
console.log("Initialize progress bar");
//console.log("Initialize progress bar");
pb1 = new $.ProgressBar({
boundingBox: '#pb1',
label: 'Progressbar!',
on: {
complete: function() {
console.log("Progress Bar COMPLETE");
//console.log("Progress Bar COMPLETE");
this.set('label', 'complete!');
if (processInstanceId) {
ProcessDiagramGenerator.drawHighLights(processInstanceId);
......@@ -67,7 +67,7 @@ $(document).ready(function(){
},
value: 0
});
console.log("Progress bar inited");
//console.log("Progress bar inited");
ProcessDiagramGenerator.options = {
/*
......@@ -77,7 +77,7 @@ $(document).ready(function(){
*/
diagramBreadCrumbsId: "diagramBreadCrumbs",
diagramHolderId: "diagramHolder",
diagramInfoId: "diagramInfo",
diagramInfoId: "diagramInfo"
};
var baseUrl = window.document.location.protocol + "//" + window.document.location.host + "/";
......@@ -87,7 +87,7 @@ $(document).ready(function(){
ActivitiRest.options = {
processInstanceHighLightsUrl: baseUrl + "/service/process-instance/{processInstanceId}/highlights?callback=?",
processDefinitionUrl: baseUrl + "/service/process-definition/{processDefinitionId}/diagram-layout?callback=?",
processDefinitionByKeyUrl: baseUrl + "/service/process-definition/{processDefinitionKey}/diagram-layout?callback=?",
processDefinitionByKeyUrl: baseUrl + "/service/process-definition/{processDefinitionKey}/diagram-layout?callback=?"
};
if (processDefinitionId) {
......@@ -96,21 +96,6 @@ $(document).ready(function(){
} else {
alert("processDefinitionId parameter is required");
}
/*
// Draw all diagrams from list
for (var i in diagrams) {
var processDefinitionId = diagrams[i];
console.log("diagramKey: " + processDefinitionId);
//pb1.set('value', 0);
setTimeout(function(processDefinitionId) {
ProcessDiagramGenerator.drawDiagram(processDefinitionId);
}(processDefinitionId));
}
*/
});
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册