简体   繁体   English

工作流基础独立架构

[英]Workflow Foundation Separate Schema

I'm working with the persistence and tracking services in Workflow Foundation and I thought it would be a good idea to use a separate schema in SQL Server just for workflow. 我正在使用Workflow Foundation中的持久性和跟踪服务,我认为在SQL Server中仅将单独的架构用于工作流是一个好主意。

Unfortunately, it appears they hard-coded the default dbo schema name into their code. 不幸的是,他们似乎将默认的dbo模式名称硬编码到了自己的代码中。 One example is the SqlTrackingService class. 一个示例是SqlTrackingService类。 Due to the way they wrote the tracking classes, I can't override the methods to provide my own db query code. 由于他们编写跟踪类的方式,我无法覆盖提供我自己的数据库查询代码的方法。

I have thought about the following options, but some don't appear to be possible: 我已经考虑过以下选项,但似乎无法实现:

  • Re-write tracking from scratch 从头开始重写跟踪
  • Disassemble and re-write tracking files (Licensing violation?) 分解并重新编写跟踪文件(是否违反许可?)
  • Some way to intercept and re-write sql query 拦截和重写SQL查询的某种方法
  • Some way to trick it into using a custom version of SqlCommand that filters CommandText 诱使它使用可过滤CommandText的自定义版本SqlCommand的方法
  • Just go ahead and use the dbo schema for the WF stuff 只需继续将dbo模式用于WF内容即可
  • Use a completely separate database for WF. 对WF使用完全独立的数据库。

Does anyone have any suggestions or options I haven't considered? 有没有人有我没有考虑过的建议或选择? Thanks. 谢谢。

In most cases I just accept the dbo scheme and sometimes move things into a separate database. 在大多数情况下,我只接受dbo方案,有时将其移至单独的数据库中。 As far as I know there is no way to intercept the commands and rewrite the scheme or table names but then I never tried either. 据我所知,没有办法拦截命令并重写方案或表名,但后来我也从未尝试过。 If you want to rewrite, I did a port, SqlCeWorkflowPersistenceService, to SQLCe and LinqToSql. 如果要重写,我对SQLCe和LinqToSql做了一个端口SqlCeWorkflowPersistenceService。 Feel free to use and/or modify it to fit your needs. 随意使用和/或修改它以满足您的需求。 See here for the code. 请参阅此处的代码。 It does pretty much the same thing as the default SqlWorkflowPersistenceService except for the ownership part which is broken anyway. 它与默认SqlWorkflowPersistenceService几乎具有相同的功能,除了所有权部分仍然被破坏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM