提交 7fd47012 编写于 作者: J Joram Barrez

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

...@@ -15,6 +15,8 @@ package org.activiti.spring.test.servicetask; ...@@ -15,6 +15,8 @@ package org.activiti.spring.test.servicetask;
import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate; import org.activiti.engine.delegate.JavaDelegate;
import org.activiti.engine.impl.el.FixedValue; import org.activiti.engine.impl.el.FixedValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* @author Joram Barrez * @author Joram Barrez
...@@ -22,15 +24,24 @@ import org.activiti.engine.impl.el.FixedValue; ...@@ -22,15 +24,24 @@ import org.activiti.engine.impl.el.FixedValue;
*/ */
public class DelegateExpressionBean implements JavaDelegate { public class DelegateExpressionBean implements JavaDelegate {
private static final Logger log = LoggerFactory.getLogger(DelegateExpressionBean.class);
private SentenceGenerator sentenceGenerator; private SentenceGenerator sentenceGenerator;
private FixedValue someField; private FixedValue someField;
public void execute(DelegateExecution execution) throws Exception { public void execute(DelegateExecution execution) throws Exception {
execution.setVariable("myVar", sentenceGenerator.getSentence()); log.info("Entering DelegateExpressionBean.execute()");
if(sentenceGenerator != null) {
execution.setVariable("myVar", sentenceGenerator.getSentence());
} else {
execution.setVariable("myVar", "SentenceGenerator is not injected by spring");
}
if (someField != null) { if (someField != null) {
execution.setVariable("fieldInjection", someField.getValue(execution)); execution.setVariable("fieldInjection", someField.getValue(execution));
} else {
execution.setVariable("fieldInjection", "Field injection not working");
} }
log.info("Leaving DelegateExpressionBean.execute()");
} }
public void setSentenceGenerator(SentenceGenerator sentenceGenerator) { public void setSentenceGenerator(SentenceGenerator sentenceGenerator) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册