在用户任务上应用边界计时器事件,在服务任务上添加java类属性,但当计时器到期触发异常列表时,会抛出,即无法找到分配给服务任务的类。类存在于类路径上。activiti配置中还启用了asyncExecutorActivate属性
这里有一个代码
<?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="http://www.activiti.org/processdef">
<process id="timertest" name="timertest" isExecutable="true">
<startEvent id="startEvent1"></startEvent>
<userTask id="sid-9F95F9B8-6C5C-4221-B3A7-3BD2BAEC22CA"></userTask>
<sequenceFlow id="sid-08270597-3D34-4CFD-BACF-CB95036CBC48" sourceRef="startEvent1" targetRef="sid-9F95F9B8-6C5C-4221-B3A7-3BD2BAEC22CA"></sequenceFlow>
<boundaryEvent id="sid-5AC91A08-17CC-4F6E-ABC2-2B8AF63EAB66" attachedToRef="sid-9F95F9B8-6C5C-4221-B3A7-3BD2BAEC22CA" cancelActivity="true">
<timerEventDefinition>
<timeDate>${expiresOn}</timeDate>
</timerEventDefinition>
</boundaryEvent>
<endEvent id="sid-1D6E7697-6ECA-42BA-98E5-BE089A78DCF2"></endEvent>
<sequenceFlow id="sid-A4C68C9C-38C3-43A9-BB3F-83FABACA65F9" sourceRef="sid-CE624FA0-9F7E-4FF9-BF3E-C016D046A3BF" targetRef="sid-1D6E7697-6ECA-42BA-98E5-BE089A78DCF2"></sequenceFlow>
<serviceTask id="sid-CE624FA0-9F7E-4FF9-BF3E-C016D046A3BF" activiti:class="com.softech.workflowengine.workflow.policyack.servicetask.TimerClass"></serviceTask>
<sequenceFlow id="sid-799456B9-F667-4E98-A856-E1AA7B79F680" sourceRef="sid-5AC91A08-17CC-4F6E-ABC2-2B8AF63EAB66" targetRef="sid-CE624FA0-9F7E-4FF9-BF3E-C016D046A3BF"></sequenceFlow>
<endEvent id="sid-705703CA-B642-435C-8393-B236EC3E964B"></endEvent>
<sequenceFlow id="sid-010B8977-34F9-40F4-B694-D56D5BA34257" sourceRef="sid-9F95F9B8-6C5C-4221-B3A7-3BD2BAEC22CA" targetRef="sid-705703CA-B642-435C-8393-B236EC3E964B"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_timertest">
<bpmndi:BPMNPlane bpmnElement="timertest" id="BPMNPlane_timertest">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="100.0" y="163.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-9F95F9B8-6C5C-4221-B3A7-3BD2BAEC22CA" id="BPMNShape_sid-9F95F9B8-6C5C-4221-B3A7-3BD2BAEC22CA">
<omgdc:Bounds height="80.0" width="100.0" x="175.0" y="138.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-5AC91A08-17CC-4F6E-ABC2-2B8AF63EAB66" id="BPMNShape_sid-5AC91A08-17CC-4F6E-ABC2-2B8AF63EAB66">
<omgdc:Bounds height="31.0" width="31.0" x="253.59371010330312" y="202.75947444214634"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-1D6E7697-6ECA-42BA-98E5-BE089A78DCF2" id="BPMNShape_sid-1D6E7697-6ECA-42BA-98E5-BE089A78DCF2">
<omgdc:Bounds height="28.0" width="28.0" x="405.0" y="311.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-CE624FA0-9F7E-4FF9-BF3E-C016D046A3BF" id="BPMNShape_sid-CE624FA0-9F7E-4FF9-BF3E-C016D046A3BF">
<omgdc:Bounds height="80.0" width="100.0" x="210.0" y="285.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-705703CA-B642-435C-8393-B236EC3E964B" id="BPMNShape_sid-705703CA-B642-435C-8393-B236EC3E964B">
<omgdc:Bounds height="28.0" width="28.0" x="320.0" y="164.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-A4C68C9C-38C3-43A9-BB3F-83FABACA65F9" id="BPMNEdge_sid-A4C68C9C-38C3-43A9-BB3F-83FABACA65F9">
<omgdi:waypoint x="310.0" y="325.0"></omgdi:waypoint>
<omgdi:waypoint x="405.0" y="325.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-799456B9-F667-4E98-A856-E1AA7B79F680" id="BPMNEdge_sid-799456B9-F667-4E98-A856-E1AA7B79F680">
<omgdi:waypoint x="269.5937101033031" y="234.75947444214634"></omgdi:waypoint>
<omgdi:waypoint x="269.5937101033031" y="259.3797372210732"></omgdi:waypoint>
<omgdi:waypoint x="260.0" y="259.3797372210732"></omgdi:waypoint>
<omgdi:waypoint x="260.0" y="285.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-08270597-3D34-4CFD-BACF-CB95036CBC48" id="BPMNEdge_sid-08270597-3D34-4CFD-BACF-CB95036CBC48">
<omgdi:waypoint x="130.0" y="178.0"></omgdi:waypoint>
<omgdi:waypoint x="175.0" y="178.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-010B8977-34F9-40F4-B694-D56D5BA34257" id="BPMNEdge_sid-010B8977-34F9-40F4-B694-D56D5BA34257">
<omgdi:waypoint x="275.0" y="178.0"></omgdi:waypoint>
<omgdi:waypoint x="320.0" y="178.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
package com.softech.workflowengine.workflow.policyack.servicetask;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
public class TimerClass implements JavaDelegate{
@Override
public void execute(DelegateExecution execution) {
System.out.println(">> in TimerClass ");
}
}
例外
07:56:03,977 [activiti-async-job-executor-thread-2] ERROR org.activiti.engine.impl.interceptor.CommandContext - Error while closing command context
org.activiti.engine.ActivitiException: couldn't instantiate class com.softech.workflowengine.workflow.policyack.servicetask.TimerClass
at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:137)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.defaultInstantiateDelegate(ClassDelegate.java:306)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java:295)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getActivityBehaviorInstance(ClassDelegate.java:273)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:217)
at org.activiti.engine.impl.agenda.ContinueProcessOperation.executeActivityBehavior(ContinueProcessOperation.java:180)
at org.activiti.engine.impl.agenda.ContinueProcessOperation.executeSynchronous(ContinueProcessOperation.java:131)
at org.activiti.engine.impl.agenda.ContinueProcessOperation.continueThroughFlowNode(ContinueProcessOperation.java:89)
at org.activiti.engine.impl.agenda.ContinueProcessOperation.run(ContinueProcessOperation.java:55)
at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:73)
at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:57)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:42)
at org.activiti.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:48)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:63)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:29)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:44)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:39)
at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:97)
at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.activiti.engine.ActivitiClassLoadingException: Class not found: com.softech.workflowengine.workflow.policyack.servicetask.TimerClass
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:87)
at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:134)
... 24 more
Caused by: java.lang.ClassNotFoundException: com.softech.workflowengine.workflow.policyack.servicetask.TimerClass
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1854)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:288)
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:68)
... 25 more
07:56:04,000 [activiti-async-job-executor-thread-2] ERROR org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable - Job 130011 failed
org.activiti.engine.ActivitiException: couldn't instantiate class com.softech.workflowengine.workflow.policyack.servicetask.TimerClass
at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:137)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.defaultInstantiateDelegate(ClassDelegate.java:306)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java:295)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getActivityBehaviorInstance(ClassDelegate.java:273)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:217)
at org.activiti.engine.impl.agenda.ContinueProcessOperation.executeActivityBehavior(ContinueProcessOperation.java:180)
at org.activiti.engine.impl.agenda.ContinueProcessOperation.executeSynchronous(ContinueProcessOperation.java:131)
at org.activiti.engine.impl.agenda.ContinueProcessOperation.continueThroughFlowNode(ContinueProcessOperation.java:89)
at org.activiti.engine.impl.agenda.ContinueProcessOperation.run(ContinueProcessOperation.java:55)
at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:73)
at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:57)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:42)
at org.activiti.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:48)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:63)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:29)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:44)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:39)
at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:97)
at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Bean初始化
@Bean
public SpringProcessEngineConfiguration processEngineConfiguration() throws Exception {
SpringProcessEngineConfiguration engineConfiguration = new SpringProcessEngineConfiguration();
engineConfiguration.setDataSource(dataSource);
engineConfiguration.setTransactionManager(transactionManager);
engineConfiguration.setDatabaseSchemaUpdate(Boolean.TRUE.toString());
engineConfiguration.setAsyncExecutorActivate(true);
return engineConfiguration;
}
请注意,需要类路径中的类的线程是activiti-async-job-executor-thread-2],这会导致这样一个问题:您在哪里运行作业执行器?如何确保类在类路径中?
问题内容: 我的整个项目都使用(Bluebird)Promises,但是有一个使用EventEmitter的特定库。 我想要实现以下目标: 我在Promises链中读了EventEmitter的答案。这给了我一种执行’connect’事件的回调的方法。这是我到目前为止所到之处 现在如何进一步链接“ eventB”? 问题答案: 我假设您想为每个事件做不同的事情。即使由的动作触发,您也可以将其视为另
当我们得到空闲超时事件时,我们关闭通道。如果我们当时也启用了ssl,我们会得到: 以下是一些注意事项:https://github.com/netty/netty/issues/305 我们是否可以在空闲状态处理程序方法中进行某种清理来防止这种情况?或者我们应该在方法中捕捉到这一点吗? 一般来说,我们应该如何处理这种例外情况? 谢谢,马特
用户可以从datalist或can类型中选择一个项目,输入它自己的值。我通过JSON调用PHP脚本连接到数据库,以填充表单其余部分的其他信息。我希望当用户在列表输入中键入名称时(因此当内容模糊时),或者当用户单击DataList中的某个选项时,这会触发。 使用当输入失去焦点时会触发该函数,但当从数据列表中选择一项时,它也会等待“直到输入失去焦点,我希望事件立即触发” 使用单击datalist中的一
一点背景: 我对也做了同样的操作--创建了一个将添加到源列表的方法,并且每当更新源列表时,它将使用JavaFX线程上的UI等价类更新目标列表: 因此,现在如果我有更新的并且其项属性更新不是在JavaFX线程上,我就可以轻松地获得一个在JavaFX中显示的列表: 所以现在的问题是: 我的预期是,当显示在中时,只要值发生更改,它就会更新,但预期的行为只持续几秒钟,之后ListView停止更新,这是因为
问题内容: 我有一个div,其内容可能会以各种方式更改:例如,可以通过innerHTML重新加载其整个内容,或者可以通过DOM方法添加节点。反过来,这可能是通过本地javascript发生的,也可能是通过调用jQuery API或其他库间接发生的。 我希望在div的内容改变为执行一些代码,但我 绝对没有控制 上 如何 将改变。确实,我正在设计一个可供其他人使用的小部件,他们可以自由选择自己喜欢的d
我在Azure上有一个函数,包含以下function.json文件: 除非我错了,否则这个函数应该每天运行一次,在凌晨3点? 这是函数的签名: 我到底做错了什么?当我手动触发(在门户中单击“运行”)时,该功能工作正常,但它在今天凌晨3点没有运行,昨天也没有运行。 编辑:所以,正如建议的那样,我已经将计划更改为付费计划,并且我选择了一个动态计划。日志仍然没有说明功能在今天早上3点被激活。