Osworkflow workflow factory

xiaoxiao2021-03-06  71

We know, OsWorkflow system to and Workflows .xml resolution, is in WorkflowFactory; OSWORKFLOW workflow factories have several categories: 1) com.opensymphony.workflow.loader.XMLWorkflowFactory2) com.opensymphony.workflow.loader.JDBCWorkflowFactory3) com.opensymphony.workflow.loader.URLWorkflowFactory they extends AbstractWorkflowFactory, and they truly are calling The WorkflowLoader.Load (URL) is implemented, so their implementation is basically the same, but their Cache implementation is not the same: 1) com.opensymphony.workflow.Loader.xmlworkflowFactory Cache WorkflowConfig2 com.opensymphony. Workflow.Loader.jdbcWorkflowFactory Cache Wfconfig3) com.opensymphony.workflow.loader.urlworkflowFactory Cache WorkflowDescriptor

We see the code of XMLWorkflowFactory: WorkflowConfig C = (WorkflowConfig) Workflows.get (Name); if (c == null) {Throw new factoryException ("Unknown Workflow Name /" Name "/");} IF (c.descriptor! = null) {if (reload) {file file = new file (c.url.getfile ()); if (file.exists () && (file.lastmodified ()> c.lastmodified)) {C.lastmodified = file.lastmodified (); loadingWorkflow (c);}}} else {loadingWorkflow (c);} return c.descriptor

Everyone should see the above code, it uses the Flyweight mode, but adds an intermediate layer WorkflowConfig; the AgileFlow engine is also using the parsing of the process definition is also this mode, which can determine the user's definition in real time. Modify and make a corresponding response.

转载请注明原文地址:https://www.9cbs.com/read-88863.html

New Post(0)