归档插件:可以将流程文档归档成 HTML/PDF/PNG/JPG 文件
PDF/PNG/JPG 的归档依赖 FileConvertService 和 BroFileConverter。
为了便于本地开发调试,如果本机启动了 BroFileConverter 服务器,会忽略 bropen.framework.plugins.fileconvert.server
(详见 fileConvertService.getServer)和 grails.serverURL;
否则,需要临时修改这两个参数,如在console中执行:
grailsApplication.config.grails.serverURL = "http://192.168.0.199:8080/Foobar/"
ctx.settingService.createOrUpdate("bropen.framework.plugins.fileconvert.server", "http://a.b.c:6600")
需要注意的是,BroFileConverter 服务器要能够访问到系统参数 grails.serverURL 中的地址。
测试归档:import bropen.bpm.instance.ProcessInstance
import org.apache.commons.io.FileUtils
def service = ctx.archiveService
def pi = ProcessInstance.get(204431)
//String filename = service.archiveTo("html", pi,null,null)
String filename = service.archiveTo("pdf", pi, null, null)
if (filename) FileUtils.moveFile(new File(filename), new File("new path..."))
| Modifiers | Name | Description |
|---|---|---|
static class |
ArchiveService.ArchiveDomainClassMarshaller |
将归档的领域Bean转换成XML的编排器 |
| Modifiers | Name | Description |
|---|---|---|
static Integer |
aliasOverridingOrder |
| Fields inherited from class | Fields |
|---|---|
class bropen.framework.plugins.archive.ArchiveService |
aliasOverridingOrder, __$stMC, $ins$1grails_plugins_mail_SendMail__applicationContext, $0x001abropen_toolkit_traits_TagInvokerTrait__DEFAULT_NS, $static$1bropen_toolkit_traits_TagInvokerTrait__DEFAULT_NS, $0x000abropen_toolkit_traits_TagInvokerTrait__tagLibraryLookup, $static$1bropen_toolkit_traits_TagInvokerTrait__tagLibraryLookup, $0x000abropen_toolkit_traits_events_SyncEvents__syncEventBus, $static$1bropen_toolkit_traits_events_SyncEvents__syncEventBus, $0x000abropen_toolkit_traits_events_SyncEvents__syncEventReceivers, $static$1bropen_toolkit_traits_events_SyncEvents__syncEventReceivers, $0x000abropen_toolkit_traits_events_SyncEvents__syncEventReceiverClosures, $static$1bropen_toolkit_traits_events_SyncEvents__syncEventReceiverClosures, $0x000abropen_toolkit_traits_events_Events__eventBus, $static$1bropen_toolkit_traits_events_Events__eventBus, $0x000abropen_toolkit_traits_events_Events__eventReceivers, $static$1bropen_toolkit_traits_events_Events__eventReceivers, $0x000abropen_toolkit_traits_events_Events__eventReceiverClosures, $static$1bropen_toolkit_traits_events_Events__eventReceiverClosures, $static$1bropen_grails_ExecutorTrait__svc, $ins$1grails_events_Events__eventBus |
| Type | Name and description |
|---|---|
bropen.framework.core.AttachmentService |
attachmentService |
bropen.framework.core.biz.BizPermissionService |
bizPermissionService |
bropen.framework.core.ErrorService |
errorService |
| Type | Name and description |
|---|---|
Boolean |
archive(Object doc)归档流程文档 |
protected void |
archiveDocument(Object doc, ProcessInstance pi)对文档进行归档:默认归档策略 |
String |
archiveTo(String type, ProcessInstance pi, String filename, Closure htmlHandler)将流程文档归档为 html、pdf、图片等类型的文件 |
static void |
bootStrapInit()初始化 |
| Methods inherited from class | Name |
|---|---|
class bropen.framework.plugins.archive.ArchiveService |
bropen.framework.plugins.archive.ArchiveService#getTransactionManager(), bropen.framework.plugins.archive.ArchiveService#getOsmEmployeeService(), bropen.framework.plugins.archive.ArchiveService#setOsmEmployeeService(bropen.framework.core.OsmEmployeeService), bropen.framework.plugins.archive.ArchiveService#grails_plugins_mail_SendMailtrait$super$getApplicationContext(), bropen.framework.plugins.archive.ArchiveService#grails_plugins_mail_SendMailtrait$super$setApplicationContext(org.springframework.context.ApplicationContext), bropen.framework.plugins.archive.ArchiveService#sendMail(Closure), bropen.framework.plugins.archive.ArchiveService#grails_plugins_mail_SendMailtrait$super$sendMail(Closure), bropen.framework.plugins.archive.ArchiveService#grails_plugins_mail_SendMail__applicationContext$get(), bropen.framework.plugins.archive.ArchiveService#grails_plugins_mail_SendMail__applicationContext$set(org.springframework.context.ApplicationContext), bropen.framework.plugins.archive.ArchiveService#invokeTag(String), bropen.framework.plugins.archive.ArchiveService#invokeTag(String, Map, Closure), bropen.framework.plugins.archive.ArchiveService#invokeTag(String, Map), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_TagInvokerTrait__tagLibraryLookup$get(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_TagInvokerTrait__DEFAULT_NS$get(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_TagInvokerTrait__tagLibraryLookup$set(org.grails.taglib.TagLibraryLookup), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_TagInvokerTrait__DEFAULT_NS$set(String), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_ServletTraittrait$super$getSession(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_ServletTraittrait$super$getRequest(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_ServletTraittrait$super$getResponse(), bropen.framework.plugins.archive.ArchiveService#onSync(CharSequence, Closure), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEventstrait$super$onSync(CharSequence, Closure), bropen.framework.plugins.archive.ArchiveService#notifySync(CharSequence, Object), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEventstrait$super$notifySync(CharSequence, Object), bropen.framework.plugins.archive.ArchiveService#sendAndReceiveSync(CharSequence, Object, Closure), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEventstrait$super$sendAndReceiveSync(CharSequence, Object, Closure), bropen.framework.plugins.archive.ArchiveService#sendAndReceiveAllSync(CharSequence, Object, Closure), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEventstrait$super$sendAndReceiveAllSync(CharSequence, Object, Closure), bropen.framework.plugins.archive.ArchiveService#receiveAllSync(CharSequence, Closure), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEventstrait$super$receiveAllSync(CharSequence, Closure), bropen.framework.plugins.archive.ArchiveService#clearSyncEventConsumers(CharSequence), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEventstrait$super$clearSyncEventConsumers(CharSequence), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEvents__syncEventReceiverClosures$get(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEvents__syncEventReceivers$get(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEvents__syncEventBus$get(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEvents__syncEventBus$set(reactor.bus.EventBus), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEvents__syncEventReceivers$set(Hashtable), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_SyncEvents__syncEventReceiverClosures$set(Hashtable), bropen.framework.plugins.archive.ArchiveService#receiveAll(CharSequence, Closure), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_Eventstrait$super$receiveAll(CharSequence, Closure), bropen.framework.plugins.archive.ArchiveService#sendAndReceiveAll(CharSequence, Object, Closure), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_Eventstrait$super$sendAndReceiveAll(CharSequence, Object, Closure), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_Events__eventBus$get(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_Events__eventReceiverClosures$get(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_Events__eventReceivers$get(), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_Events__eventBus$set(reactor.bus.EventBus), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_Events__eventReceivers$set(Hashtable), bropen.framework.plugins.archive.ArchiveService#bropen_toolkit_traits_events_Events__eventReceiverClosures$set(Hashtable), bropen.framework.plugins.archive.ArchiveService#bropen_grails_ExecutorTraittrait$super$getExecutorService(), bropen.framework.plugins.archive.ArchiveService#callAsync(Closure), bropen.framework.plugins.archive.ArchiveService#bropen_grails_ExecutorTraittrait$super$callAsync(Closure), bropen.framework.plugins.archive.ArchiveService#runAsync(Runnable), bropen.framework.plugins.archive.ArchiveService#bropen_grails_ExecutorTraittrait$super$runAsync(Runnable), bropen.framework.plugins.archive.ArchiveService#bropen_grails_ExecutorTrait__svc$get(), bropen.framework.plugins.archive.ArchiveService#bropen_grails_ExecutorTrait__svc$set(grails.plugin.executor.PersistenceContextExecutorWrapper), bropen.framework.plugins.archive.ArchiveService#clearEventConsumers(Object), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$clearEventConsumers(Object), bropen.framework.plugins.archive.ArchiveService#getEventBus(), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$getEventBus(), bropen.framework.plugins.archive.ArchiveService#sendAndReceive(Object, Object, Closure), bropen.framework.plugins.archive.ArchiveService#sendAndReceive(Object, Closure, Closure), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$sendAndReceive(Object, Closure, Closure), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$sendAndReceive(Object, Object, Closure), bropen.framework.plugins.archive.ArchiveService#eventFor(Map, Object, Closure), bropen.framework.plugins.archive.ArchiveService#eventFor(Object), bropen.framework.plugins.archive.ArchiveService#eventFor(Map, Object), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$eventFor(Object), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$eventFor(Map, Object, Closure), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$eventFor(Map, Object), bropen.framework.plugins.archive.ArchiveService#setEventBus(reactor.bus.EventBus), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$setEventBus(reactor.bus.EventBus), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$on(reactor.bus.selector.Selector, reactor.fn.Consumer), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$on(Class, reactor.fn.Consumer), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$on(reactor.bus.selector.Selector, Closure), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$on(Object, reactor.fn.Consumer), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$on(Class, Closure), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$on(Object, Closure), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$notify(Object, Object), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$notify(Object, Closure), bropen.framework.plugins.archive.ArchiveService#grails_events_Eventstrait$super$notify(Object, reactor.bus.Event), bropen.framework.plugins.archive.ArchiveService#grails_events_Events__eventBus$get(), bropen.framework.plugins.archive.ArchiveService#grails_events_Events__eventBus$set(reactor.bus.EventBus), bropen.framework.plugins.archive.ArchiveService#getSettingService(), bropen.framework.plugins.archive.ArchiveService#setSettingService(bropen.framework.core.SettingService), bropen.framework.plugins.archive.ArchiveService#bootStrapInit(), bropen.framework.plugins.archive.ArchiveService#archiveTo(String, String, String, String, String, String, Closure), bropen.framework.plugins.archive.ArchiveService#archiveTo(String, String, String, String, Closure), bropen.framework.plugins.archive.ArchiveService#getFileConvertService(), bropen.framework.plugins.archive.ArchiveService#setFileConvertService(bropen.framework.plugins.fileconvert.FileConvertService), bropen.framework.plugins.archive.ArchiveService#getResponse(), bropen.framework.plugins.archive.ArchiveService#getMetaClass(), bropen.framework.plugins.archive.ArchiveService#setMetaClass(MetaClass), bropen.framework.plugins.archive.ArchiveService#getExecutorService(), bropen.framework.plugins.archive.ArchiveService#setTransactionManager(org.springframework.transaction.PlatformTransactionManager), bropen.framework.plugins.archive.ArchiveService#getSession(), bropen.framework.plugins.archive.ArchiveService#getRequest(), bropen.framework.plugins.archive.ArchiveService#access$0(bropen.framework.plugins.archive.ArchiveService, String, String, javax.servlet.http.HttpServletRequest), bropen.framework.plugins.archive.ArchiveService#this$dist$invoke$1(String, Object), bropen.framework.plugins.archive.ArchiveService#this$dist$get$1(String), bropen.framework.plugins.archive.ArchiveService#this$dist$set$1(String, Object), bropen.framework.plugins.archive.ArchiveService#getApplicationContext(), bropen.framework.plugins.archive.ArchiveService#setApplicationContext(org.springframework.context.ApplicationContext), bropen.framework.plugins.archive.ArchiveService#setProperty(String, Object), bropen.framework.plugins.archive.ArchiveService#getProperty(String), bropen.framework.plugins.archive.ArchiveService#notify(Object, Closure), bropen.framework.plugins.archive.ArchiveService#notify(Object, Object), bropen.framework.plugins.archive.ArchiveService#notify(Object, reactor.bus.Event), bropen.framework.plugins.archive.ArchiveService#m(Map), bropen.framework.plugins.archive.ArchiveService#on(Class, reactor.fn.Consumer), bropen.framework.plugins.archive.ArchiveService#on(Class, Closure), bropen.framework.plugins.archive.ArchiveService#on(Object, reactor.fn.Consumer), bropen.framework.plugins.archive.ArchiveService#on(Object, Closure), bropen.framework.plugins.archive.ArchiveService#on(reactor.bus.selector.Selector, reactor.fn.Consumer), bropen.framework.plugins.archive.ArchiveService#on(reactor.bus.selector.Selector, Closure), bropen.framework.plugins.archive.ArchiveService#invokeMethod(String, Object), bropen.framework.plugins.archive.ArchiveService#wait(long, int), bropen.framework.plugins.archive.ArchiveService#wait(long), bropen.framework.plugins.archive.ArchiveService#wait(), bropen.framework.plugins.archive.ArchiveService#equals(Object), bropen.framework.plugins.archive.ArchiveService#toString(), bropen.framework.plugins.archive.ArchiveService#hashCode(), bropen.framework.plugins.archive.ArchiveService#getClass(), bropen.framework.plugins.archive.ArchiveService#notify(), bropen.framework.plugins.archive.ArchiveService#notifyAll() |
class Object |
Object#wait(long, int), Object#wait(long), Object#wait(), Object#equals(Object), Object#toString(), Object#hashCode(), Object#getClass(), Object#notify(), Object#notifyAll() |
归档流程文档
例如:ctx.archiveService.archive(ProcessInstance.get(19).document())
doc - 文档对象对文档进行归档:默认归档策略
将流程文档归档为 html、pdf、图片等类型的文件
例如:ctx.archiveService.archiveTo("png", ProcessInstance.get(19), null, null)
pi - 流程实例初始化