未验证 提交 1f83c9f4 编写于 作者: S salaboy 提交者: GitHub

Merge pull request #2374 from Activiti/daisuke-2184-json-el-resolver

Handling expressions for json variables
/* 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.
......@@ -14,90 +14,117 @@ package org.activiti.engine.impl.el;
import java.beans.FeatureDescriptor;
import java.util.Iterator;
import java.util.List;
import javax.el.ELContext;
import javax.el.ELResolver;
import org.activiti.engine.delegate.VariableScope;
import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.identity.Authentication;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.persistence.entity.TaskEntity;
import org.activiti.engine.impl.persistence.entity.VariableInstance;
import com.fasterxml.jackson.databind.JsonNode;
/**
* Implementation of an {@link ELResolver} that resolves expressions with the process variables of a given {@link VariableScope} as context. <br>
* Also exposes the currently logged in username to be used in expressions (if any)
* Implementation of an {@link ELResolver} that resolves expressions with the
* process variables of a given {@link VariableScope} as context. <br>
* Also exposes the currently logged in username to be used in expressions (if
* any)
*
*
*
*/
public class VariableScopeElResolver extends ELResolver {
public static final String EXECUTION_KEY = "execution";
public static final String TASK_KEY = "task";
public static final String LOGGED_IN_USER_KEY = "authenticatedUserId";
protected VariableScope variableScope;
public VariableScopeElResolver(VariableScope variableScope) {
this.variableScope = variableScope;
}
public Object getValue(ELContext context, Object base, Object property) {
if (base == null) {
String variable = (String) property; // according to javadoc, can only be a String
if ((EXECUTION_KEY.equals(property) && variableScope instanceof ExecutionEntity) || (TASK_KEY.equals(property) && variableScope instanceof TaskEntity)) {
context.setPropertyResolved(true);
return variableScope;
} else if (EXECUTION_KEY.equals(property) && variableScope instanceof TaskEntity) {
context.setPropertyResolved(true);
return ((TaskEntity) variableScope).getExecution();
} else if (LOGGED_IN_USER_KEY.equals(property)) {
context.setPropertyResolved(true);
return Authentication.getAuthenticatedUserId();
} else {
if (variableScope.hasVariable(variable)) {
context.setPropertyResolved(true); // if not set, the next elResolver in the CompositeElResolver will be called
return variableScope.getVariable(variable);
}
}
}
// property resolution (eg. bean.value) will be done by the
// BeanElResolver (part of the CompositeElResolver)
// It will use the bean resolved in this resolver as base.
return null;
}
public boolean isReadOnly(ELContext context, Object base, Object property) {
if (base == null) {
String variable = (String) property;
return !variableScope.hasVariable(variable);
}
return true;
}
public void setValue(ELContext context, Object base, Object property, Object value) {
if (base == null) {
String variable = (String) property;
if (variableScope.hasVariable(variable)) {
variableScope.setVariable(variable, value);
}
}
}
public Class<?> getCommonPropertyType(ELContext arg0, Object arg1) {
return Object.class;
}
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext arg0, Object arg1) {
return null;
}
public Class<?> getType(ELContext arg0, Object arg1, Object arg2) {
return Object.class;
}
public static final String EXECUTION_KEY = "execution";
public static final String TASK_KEY = "task";
public static final String LOGGED_IN_USER_KEY = "authenticatedUserId";
protected VariableScope variableScope;
public VariableScopeElResolver(VariableScope variableScope) {
this.variableScope = variableScope;
}
@Override
public Object getValue(ELContext context, Object base, Object property) {
if (base == null) {
String variable = (String) property; // according to javadoc, can
// only be a String
if ((EXECUTION_KEY.equals(property) && variableScope instanceof ExecutionEntity)
|| (TASK_KEY.equals(property) && variableScope instanceof TaskEntity)) {
context.setPropertyResolved(true);
return variableScope;
} else if (EXECUTION_KEY.equals(property) && variableScope instanceof TaskEntity) {
context.setPropertyResolved(true);
return ((TaskEntity) variableScope).getExecution();
} else if (LOGGED_IN_USER_KEY.equals(property)) {
context.setPropertyResolved(true);
return Authentication.getAuthenticatedUserId();
} else {
if (variableScope.hasVariable(variable)) {
context.setPropertyResolved(true); // if not set, the next
// elResolver in the
// CompositeElResolver
// will be called
VariableInstance variableInstance = variableScope.getVariableInstance(variable);
Object value = variableInstance.getValue();
if (("json".equals(variableInstance.getTypeName())
|| "longJson".equals(variableInstance.getTypeName())) && (value instanceof JsonNode)
&& ((JsonNode) value).isArray()) {
return Context.getProcessEngineConfiguration().getObjectMapper().convertValue(value,
List.class);
} else {
return value;
}
}
}
}
// property resolution (eg. bean.value) will be done by the
// BeanElResolver (part of the CompositeElResolver)
// It will use the bean resolved in this resolver as base.
return null;
}
@Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
if (base == null) {
String variable = (String) property;
return !variableScope.hasVariable(variable);
}
return true;
}
@Override
public void setValue(ELContext context, Object base, Object property, Object value) {
if (base == null) {
String variable = (String) property;
if (variableScope.hasVariable(variable)) {
variableScope.setVariable(variable, value);
}
}
}
@Override
public Class<?> getCommonPropertyType(ELContext arg0, Object arg1) {
return Object.class;
}
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext arg0, Object arg1) {
return null;
}
@Override
public Class<?> getType(ELContext arg0, Object arg1, Object arg2) {
return Object.class;
}
}
package org.activiti.engine.test.json;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.impl.test.ResourceActivitiTestCase;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.IdentityLink;
import org.activiti.engine.task.Task;
import org.activiti.engine.test.Deployment;
import org.activiti.examples.variables.SomeSerializable;
public class SerializePOJOJsonTest extends ResourceActivitiTestCase {
public SerializePOJOJsonTest() {
super("org/activiti/standalone/cfg/variable/custom-serialize-variables-activiti.cfg.xml");
}
@Deployment
public void testJsonVarInExpression() throws Exception {
Map<String, Object> vars = new HashMap<String, Object>();
Map<String, Object> map = new HashMap<String, Object>();
map.put("assignee", "salaboy");
map.put("category", "test");
Map<String, Object> mapInMap = new HashMap<String, Object>();
mapInMap.put("user", "salaboy");
map.put("mapInMap", mapInMap);
vars.put("userMap", map);
List<String> list = Arrays.asList("salaboy", "salaboy", "salaboy");
vars.put("userCollection", list);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testJsonVarInExpression", vars);
String taskId = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult().getId();
taskService.complete(taskId);
taskId = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult().getId();
taskService.getIdentityLinksForTask(taskId).stream().forEach(new Consumer<IdentityLink>() {
@Override
public void accept(IdentityLink i) {
if ("candidate".equals(i.getType()) ) {
assertEquals("salaboy", i.getUserId());
}
}
});
taskService.complete(taskId);
HistoricTaskInstance task = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
assertEquals("salaboy", task.getAssignee());
assertEquals("test", task.getCategory());
}
@Deployment
public void testCollectionJsonVarInExpression() throws Exception {
Map<String, Object> vars = new HashMap<String, Object>();
List<String> list = Arrays.asList("salaboy", "salaboy", "salaboy");
vars.put("userCollection", list);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testCollectionJsonVarInExpression", vars);
String taskId = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult().getId();
taskService.complete(taskId);
List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
assertEquals(3, tasks.size());
tasks.forEach(task -> taskService.complete(task.getId()));
}
@Deployment
public void testCollectionInJsonVarInExpression() throws Exception {
Map<String, Object> vars = new HashMap<String, Object>();
List<String> list = Arrays.asList("salaboy", "salaboy", "salaboy");
Map<String, Object> map = new HashMap<String, Object>();
map.put("userCollection", list);
vars.put("userMap", map);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testCollectionInJsonVarInExpression", vars);
String taskId = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult().getId();
taskService.complete(taskId);
taskService.createTaskQuery().processInstanceId(processInstance.getId()).list().forEach(task -> taskService.complete(task.getId()));
vars = new HashMap<String, Object>();
List<SomeSerializable> beanList = Arrays.asList(new SomeSerializable("salaboy"), new SomeSerializable("salaboy"), new SomeSerializable("salaboy"));
map = new HashMap<String, Object>();
map.put("userCollection", beanList);
vars.put("userMap", map);
processInstance = runtimeService.startProcessInstanceByKey("testCollectionInJsonVarInExpression", vars);
taskId = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult().getId();
taskService.complete(taskId);
List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
assertEquals(3, tasks.size());
tasks.forEach(task -> taskService.complete(task.getId()));
}
@Deployment
public void testPOJOCollectionInJsonVarInExpression() throws Exception {
Map<String, Object> vars = new HashMap<String, Object>();
Map<String, Object> map = new HashMap<String, Object>();
vars = new HashMap<String, Object>();
List<SomeSerializable> beanList = Arrays.asList(new SomeSerializable("salaboy"), new SomeSerializable("salaboy"), new SomeSerializable("salaboy"));
map = new HashMap<String, Object>();
map.put("userCollection", beanList);
vars.put("userMap", map);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testPOJOCollectionInJsonVarInExpression", vars);
String taskId = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult().getId();
taskService.complete(taskId);
List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
assertEquals(3, tasks.size());
tasks.forEach(task -> taskService.complete(task.getId()));
}
}
\ 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:xsd="http://www.w3.org/2001/XMLSchema" 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="Examples">
<process id="testCollectionInJsonVarInExpression" name="Test Collection In Json Var In Expression" isExecutable="true">
<startEvent id="theStart"></startEvent>
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="userTask"></sequenceFlow>
<userTask id="userTask"></userTask>
<endEvent id="theEndSuccess"></endEvent>
<userTask id="usertask1" name="User Task">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${userMap.userCollection}"></multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id="flow2" sourceRef="userTask" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="usertask1" targetRef="theEndSuccess"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_testCollectionInJsonVarInExpression">
<bpmndi:BPMNPlane bpmnElement="testCollectionInJsonVarInExpression" id="BPMNPlane_testCollectionInJsonVarInExpression">
<bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
<omgdc:Bounds height="35.0" width="35.0" x="70.0" y="95.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="userTask" id="BPMNShape_userTask">
<omgdc:Bounds height="60.0" width="100.0" x="170.0" y="83.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="theEndSuccess" id="BPMNShape_theEndSuccess">
<omgdc:Bounds height="35.0" width="35.0" x="490.0" y="95.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="310.0" y="85.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="105.0" y="112.0"></omgdi:waypoint>
<omgdi:waypoint x="170.0" y="113.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="270.0" y="113.0"></omgdi:waypoint>
<omgdi:waypoint x="310.0" y="112.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="415.0" y="112.0"></omgdi:waypoint>
<omgdi:waypoint x="490.0" y="112.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ 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:xsd="http://www.w3.org/2001/XMLSchema" 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="Examples">
<process id="testCollectionJsonVarInExpression" name="Test Collection Json Var In Expression" isExecutable="true">
<startEvent id="theStart"></startEvent>
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="userTask"></sequenceFlow>
<userTask id="userTask"></userTask>
<endEvent id="theEndSuccess"></endEvent>
<userTask id="usertask1" name="User Task">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${userCollection}"></multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id="flow2" sourceRef="userTask" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="usertask1" targetRef="theEndSuccess"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_testCollectionJsonVarInExpression">
<bpmndi:BPMNPlane bpmnElement="testCollectionJsonVarInExpression" id="BPMNPlane_testCollectionJsonVarInExpression">
<bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
<omgdc:Bounds height="35.0" width="35.0" x="70.0" y="95.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="userTask" id="BPMNShape_userTask">
<omgdc:Bounds height="60.0" width="100.0" x="170.0" y="83.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="theEndSuccess" id="BPMNShape_theEndSuccess">
<omgdc:Bounds height="35.0" width="35.0" x="490.0" y="95.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="310.0" y="85.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="105.0" y="112.0"></omgdi:waypoint>
<omgdi:waypoint x="170.0" y="113.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="270.0" y="113.0"></omgdi:waypoint>
<omgdi:waypoint x="310.0" y="112.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="415.0" y="112.0"></omgdi:waypoint>
<omgdi:waypoint x="490.0" y="112.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ 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:xsd="http://www.w3.org/2001/XMLSchema" 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="Examples">
<process id="testJsonVarInExpression" name="Test Json Var In Expression" isExecutable="true">
<startEvent id="theStart"></startEvent>
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="userTask"></sequenceFlow>
<userTask id="userTask"></userTask>
<endEvent id="theEndSuccess"></endEvent>
<userTask id="usertask1" name="User Task" activiti:assignee="${userMap.assignee}" activiti:candidateUsers="${userMap.mapInMap.user}" activiti:category="${userMap.category}"></userTask>
<sequenceFlow id="flow2" sourceRef="userTask" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="usertask1" targetRef="theEndSuccess"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_testJsonVarInExpression">
<bpmndi:BPMNPlane bpmnElement="testJsonVarInExpression" id="BPMNPlane_testJsonVarInExpression">
<bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
<omgdc:Bounds height="35.0" width="35.0" x="70.0" y="95.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="userTask" id="BPMNShape_userTask">
<omgdc:Bounds height="60.0" width="100.0" x="170.0" y="83.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="theEndSuccess" id="BPMNShape_theEndSuccess">
<omgdc:Bounds height="35.0" width="35.0" x="490.0" y="95.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="310.0" y="85.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="105.0" y="112.0"></omgdi:waypoint>
<omgdi:waypoint x="170.0" y="113.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="270.0" y="113.0"></omgdi:waypoint>
<omgdi:waypoint x="310.0" y="112.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="415.0" y="112.0"></omgdi:waypoint>
<omgdi:waypoint x="490.0" y="112.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ 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:xsd="http://www.w3.org/2001/XMLSchema" 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="Examples">
<process id="testPOJOCollectionInJsonVarInExpression" name="Test POJO Collection In Json Var In Expression" isExecutable="true">
<startEvent id="theStart"></startEvent>
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="userTask"></sequenceFlow>
<userTask id="userTask"></userTask>
<endEvent id="theEndSuccess"></endEvent>
<userTask id="usertask1" name="User Task" activiti:assignee="${userMap.userCollection.get(0).value}">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${userMap.userCollection}"></multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id="flow2" sourceRef="userTask" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="usertask1" targetRef="theEndSuccess"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_testPOJOCollectionInJsonVarInExpression">
<bpmndi:BPMNPlane bpmnElement="testPOJOCollectionInJsonVarInExpression" id="BPMNPlane_testPOJOCollectionInJsonVarInExpression">
<bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
<omgdc:Bounds height="35.0" width="35.0" x="70.0" y="95.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="userTask" id="BPMNShape_userTask">
<omgdc:Bounds height="60.0" width="100.0" x="170.0" y="83.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="theEndSuccess" id="BPMNShape_theEndSuccess">
<omgdc:Bounds height="35.0" width="35.0" x="490.0" y="95.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="310.0" y="85.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="105.0" y="112.0"></omgdi:waypoint>
<omgdi:waypoint x="170.0" y="113.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="270.0" y="113.0"></omgdi:waypoint>
<omgdi:waypoint x="310.0" y="112.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="415.0" y="112.0"></omgdi:waypoint>
<omgdi:waypoint x="490.0" y="112.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
<property name="jdbcUrl" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000;MVCC=TRUE" />
<property name="jdbcDriver" value="org.h2.Driver" />
<property name="jdbcUsername" value="sa" />
<property name="jdbcPassword" value="" />
<!-- Database configurations -->
<property name="databaseSchemaUpdate" value="drop-create" />
<!-- Test logger -->
<!-- <property name="configurators">
<list>
<bean class="org.activiti.engine.test.impl.logger.ProcessExecutionLoggerConfigurator" />
</list>
</property> -->
<!-- job executor configurations -->
<property name="asyncExecutor" ref="asyncExecutor" />
<property name="asyncExecutorActivate" value="true" />
<property name="asyncFailedJobWaitTime" value="1" />
<!-- mail server configurations -->
<property name="mailServerPort" value="5025" />
<property name="mailServers">
<map>
<entry key="myEmailTenant">
<bean class="org.activiti.engine.cfg.MailServerInfo">
<property name="mailServerHost" value="localhost" />
<property name="mailServerPort" value="5025" />
<property name="mailServerUseSSL" value="false" />
<property name="mailServerUseTLS" value="false" />
<property name="mailServerDefaultFrom" value="activiti@myTenant.com" />
<property name="mailServerUsername" value="activiti@myTenant.com" />
<property name="mailServerPassword" value="password" />
</bean>
</entry>
</map>
</property>
<property name="history" value="full" />
<property name="enableProcessDefinitionInfoCache" value="true" />
<property name="serializePOJOsInVariablesToJson" value="true" />
</bean>
<bean id="asyncExecutor" class="org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor">
<property name="defaultAsyncJobAcquireWaitTimeInMillis" value="1000" />
<property name="defaultTimerJobAcquireWaitTimeInMillis" value="1000" />
</bean>
</beans>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册