application.yml
camunda:
bpm:
client:
subscriptions:
creditScoreChecker:
process-definition-key: Process_work_task
include-extension-properties: true
variable-names: defaultScore
# 引擎根路径
base-url: http://localhost:8080/engine-rest
# 长轮询时间间隔
async-response-timeout: 2000
# 一次最多拉取任务数量
max-tasks: 1
# 全局订阅topiv上锁时间、单位毫秒,锁住期间,其他订阅者不拉取任务
lock-duration: 1000
# 指定工作节点ID
worker-id: camunda-demo
@Configuration
@ExternalTaskSubscription(“try_self_repair”)
public class RepairSubscribe implements ExternalTaskHandler {
@Override
public void execute(ExternalTask externalTask, ExternalTaskService externalTaskService) {
// add your business logic here
System.out.println("try_self_repair");
Map<String, Object> variables = new HashMap<>();
variables.put("isFree", true);
externalTaskService.complete(externalTask);
}
}
exception:
bpm.client.topic.impl.TopicSubscriptionManager.handleExternalTask(TopicSubscriptionManager.java:155) [camunda-external-task-client-7.19.0.jar:7.19.0]
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.lambda$acquire$0(TopicSubscriptionManager.java:109) [camunda-external-task-client-7.19.0.jar:7.19.0]
at java.util.Arrays$ArrayList.forEach(Arrays.java:3880) ~[na:1.8.0_391]
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.acquire(TopicSubscriptionManager.java:104) [camunda-external-task-client-7.19.0.jar:7.19.0]
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.run(TopicSubscriptionManager.java:88) [camunda-external-task-client-7.19.0.jar:7.19.0]
at java.lang.Thread.run(Thread.java:750) ~[na:1.8.0_391]
Caused by: org.camunda.bpm.client.exception.RestException: Unknown property used in expression: ${doRepair}. Cause: Cannot resolve identifier ‘doRepair’
at org.camunda.bpm.client.impl.EngineRestExceptionDto.toRestException(EngineRestExceptionDto.java:52) ~[camunda-external-task-client-7.19.0.jar:7.19.0]
at org.camunda.bpm.client.impl.RequestExecutor$1.handleResponse(RequestExecutor.java:133) ~[camunda-external-task-client-7.19.0.jar:7.19.0]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:223) ~[httpclient-4.5.13.jar:4.5.13]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165) ~[httpclient-4.5.13.jar:4.5.13]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:140) ~[httpclient-4.5.13.jar:4.5.13]
at org.camunda.bpm.client.impl.RequestExecutor.executeRequest(RequestExecutor.java:88) ~[camunda-external-task-client-7.19.0.jar:7.19.0]
at org.camunda.bpm.client.impl.RequestExecutor.postRequest(RequestExecutor.java:74) ~[camunda-external-task-client-7.19.0.jar:7.19.0]
at org.camunda.bpm.client.impl.EngineClient.complete(EngineClient.java:107) ~[camunda-external-task-client-7.19.0.jar:7.19.0]
at org.camunda.bpm.client.task.impl.ExternalTaskServiceImpl.complete(ExternalTaskServiceImpl.java:99) ~[camunda-external-task-client-7.19.0.jar:7.19.0]
… 9 common frames omitted
work_task.bpmn (5.2 KB)