jBPM6 中的文件自定义字段类型

File custom field type in jBPM6

实际上,我正在尝试将文件字段类型添加到任务表单中,用户将能够在任务表单中上传文件。

我做相应的程序:

1) 蚂蚁clean.demo

2) 添加 "File Input": new org.jbpm.formModeler.core.fieldTypes.file.FileCustomType() tp the jBPM-installer/conf/META-INF/ CustomWorkItemHandlers.conf

3) 添加 cutomFieldType.jar(包括以下 https://github.com/droolsjbpm/jbpm-form-modeler/tree/master/jbpm-form-modeler-sample-custom-types/jbpm-form-modeler-custom-file-type. 的构建)到 WEB/lib

4) 蚂蚁install.demo

5) 蚂蚁start.demo

但不幸的是我面临部署失败 这是错误:

2015-01-23 11:52:35,578 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."jbpm-console.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."jbpm-console.war".WeldStartService: Failed to start service
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name fdch resolves to beans: 
  - Managed Bean [class org.jbpm.formModeler.fieldTypes.document.handling.FileDownloadHandler] with qualifiers [@Default @Named @Any],
  - Managed Bean [class org.jbpm.formModeler.core.fieldTypes.file.FileDownloadHandler] with qualifiers [@Default @Named @Any]
    at org.jboss.weld.bootstrap.ConcurrentValidator.doWork(ConcurrentValidator.java:134)
    at org.jboss.weld.bootstrap.ConcurrentValidator.doWork(ConcurrentValidator.java:130)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory.call(IterativeWorkerTaskFactory.java:60)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory.call(IterativeWorkerTaskFactory.java:53)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_67]
    ... 3 more

如果我遗漏了什么,你能帮我吗???

出现这个问题是因为在两个不同的 jar 中有两个具有相同名称 (fdch) 的 bean

(jbpm-form-modeler-custom-file-type.jar) 和你的 jar (cutomFieldType.jar)

您需要将此 class 的 bean 名称更改为另一个名称,例如 (@Named("mybean"))

https://github.com/droolsjbpm/jbpm-form-modeler/blob/master/jbpm-form-modeler-sample-custom-types/jbpm-form-modeler-custom-file-type/src/main/java/org/jbpm/formModeler/core/fieldTypes/file/FileDownloadHandler.java

或者您可以从 web-inf\ib

中删除 jbpm-form-modeler-custom-file-type.jar