-
大小: 20.79MB文件类型: .zip金币: 2下载: 1 次发布日期: 2023-06-18
- 语言: 其他
- 标签: osworkflow
资源简介
osworkflow-2.8.0
工作流引擎
代码片段和文件信息
package com.opensymphony.workflow.config;
import java.io.*;
import java.util.*;
import java.net.URL;
import com.opensymphony.workflow.FactoryException;
import com.opensymphony.workflow.designer.event.WorkspaceListener;
import com.opensymphony.workflow.designer.event.WorkspaceEvent;
import com.opensymphony.workflow.loader.RemoteWorkspace;
import com.opensymphony.workflow.loader.WorkflowFactory;
import com.opensymphony.workflow.designer.DesignerService;
/**
* @author Hani Suleiman (hani@formicary.net)
* Date: May 15 2003
* Time: 7:57:28 PM
*/
public class WorkspaceManager
{
//private Workspace currentWorkspace = null;
private WorkflowFactory currentWorkspace = null;
private Collection listeners;
public void loadWorkspace(URL url) throws FactoryException IOException
{
fireWorkspaceClosed();
saveWorkspace();
DefaultConfiguration config = new DefaultConfiguration();
config.load(url);
currentWorkspace = config.getFactory();
fireWorkspaceOpened();
}
public void loadServiceWorkspace(DesignerService service) throws FactoryException IOException
{
fireWorkspaceClosed();
saveWorkspace();
currentWorkspace = new RemoteWorkspace(service);
currentWorkspace.initDone();
fireWorkspaceOpened();
}
public void addWorkspaceListener(WorkspaceListener listener)
{
if(listeners==null)
{
listeners = new HashSet();
}
listeners.add(listener);
}
public void removeWorkspaceListener(WorkspaceListener listener)
{
if(listeners==null) return;
listeners.remove(listener);
}
protected void fireWorkspaceOpened()
{
if(listeners==null) return;
WorkspaceEvent event = new WorkspaceEvent(this currentWorkspace WorkspaceEvent.WORKSPACE_OPENED);
notifyListeners(event);
}
protected void fireWorkspaceClosed()
{
if(listeners==null) return;
WorkspaceEvent event = new WorkspaceEvent(this currentWorkspace WorkspaceEvent.WORKSPACE_CLOSED);
notifyListeners(event);
}
private void notifyListeners(WorkspaceEvent event)
{
Iterator iter = listeners.iterator();
while(iter.hasNext())
{
WorkspaceListener listener = (WorkspaceListener)iter.next();
listener.workspaceChanged(event);
if(event.isConsumed()) return;
}
}
public void setCurrentWorkspace(WorkflowFactory current)
{
saveWorkspace();
if(this.currentWorkspace!=null)
fireWorkspaceClosed();
currentWorkspace = current;
if(currentWorkspace!=null)
fireWorkspaceOpened();
}
public void saveWorkspace()
{
if(currentWorkspace!=null)
{
currentWorkspace.save();
}
}
public WorkflowFactory getCurrentWorkspace()
{
return currentWorkspace;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 80 2006-02-04 22:40 build.properties
文件 10965 2006-02-04 22:40 build.xm
文件 440497 2006-02-04 22:40 designer.jar
目录 0 2006-02-04 22:40 docs\
文件 1269 2006-02-04 22:40 docs\1. Getting Started.html
文件 21199 2006-02-04 22:40 docs\1. Your first workflow - Chinese.html
文件 22543 2006-02-04 22:40 docs\1. Your first workflow.html
文件 2908 2006-02-04 22:40 docs\1.1 Introduction.html
文件 3399 2006-02-04 22:40 docs\1.2 Requirements.html
文件 26904 2006-02-04 22:40 docs\1.3 Running the Example App.html
文件 13980 2006-02-04 22:40 docs\1.4 Persistence Options.html
文件 4258 2006-02-04 22:40 docs\1.5 Loading Workflow Definitions.html
文件 2893 2006-02-04 22:40 docs\2. Integration with Other Modules.html
文件 8191 2006-02-04 22:40 docs\2. Testing your workflow - Chinese.html
文件 9299 2006-02-04 22:40 docs\2. Testing your workflow.html
文件 9280 2006-02-04 22:40 docs\2.3 Spring fr
文件 9628 2006-02-04 22:40 docs\3. Further desc
文件 10472 2006-02-04 22:40 docs\3. Further desc
文件 1501 2006-02-04 22:40 docs\3. Understanding OSWorkflow.html
文件 3134 2006-02-04 22:40 docs\3.1 Workflow Definition.html
文件 21608 2006-02-04 22:40 docs\3.2 Workflow Concepts.html
目录 0 2006-02-04 22:40 docs\3.2 Workflow Concepts_attachments\
文件 11229 2006-02-04 22:40 docs\3.2 Workflow Concepts_attachments\actionfunctions.png
文件 17118 2006-02-04 22:40 docs\3.2 Workflow Concepts_attachments\stepfunction.png
文件 3057 2006-02-04 22:40 docs\3.3 Common and Global Actions.html
文件 2225 2006-02-04 22:40 docs\3.4 Functions.html
文件 4967 2006-02-04 22:40 docs\3.4.1 Java-ba
文件 3851 2006-02-04 22:40 docs\3.4.2 BeanShell Functions.html
文件 2397 2006-02-04 22:40 docs\3.4.3 BSF Functions.html
文件 2969 2006-02-04 22:40 docs\3.4.4 Utility Functions.html
文件 2108 2006-02-04 22:40 docs\3.5 Validators.html
............此处省略1404个文件信息
评论
共有 条评论