请教各位osworkflow新建工作流初始化报错! Workflow wf = new BasicWorkflow((String) session.getAttribute("username"));wf.setConfiguration(workflowConfiguration);…… 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 sgdb: 老兄能不能讲具体一点! 可能不是Configuration的问题刚才仔细看了一下,你的examples是什么?是xml文件么? 如果是你的xml文件并且就在newworkflow的目录下,那么试试:id = wf.initialize("example.xml", 1, null); sgdb: 老兄我现在把我的配制文件及相关代码详细列出请指点!谢谢!我的开发环境为: jbuilder9.0+jboss4.0工程名为testworkflow.jpx webapp(web应用程序名): testworkflowweb新建工作流:newworkflow.jsp代码:(登录时新建了用户放在session.getAttribute("username")中) Workflow wf = new BasicWorkflow((String) session.getAttribute("username")); DefaultConfiguration configs = new DefaultConfiguration(); wf.setConfiguration(configs); id = wf.initialize("example",1, null); out.print("得到工作流实例为:"+Long.toString(id)+"<br><br>");osworkflow配置文件如下: 在 testworkflow\testworkflowweb\WEB-INF目录下有如下文件 1.workflows.xml 2.osworkflow.xml 3.example.xml osworkflow.xml的内容: <osworkflow> <persistence class="com.opensymphony.workflow.spi.memory.MemoryWorkflowStore"/> <factory class="com.opensymphony.workflow.loader.XMLWorkflowFactory"> <property key="resource" value="workflows.xml" /> </factory> </osworkflow>workflows.xml的内容:<workflows> <workflow name="example" type="resource" location="example.xml"/></workflows>example.xml的内容:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.7//EN" "http://www.opensymphony.com/osworkflow/workflow_2_7.dtd"><workflow> <initial-actions> <action id="1" name="Start Workflow"> <results> <unconditional-result old-status="Finished" status="Queued" step="1"/> </results> </action> </initial-actions> <steps> <step id="1" name="First Draft"> <actions> <action id="1" name="Start First Draft"> <restrict-to> <conditions> <condition type="class"> <arg name="class.name"> com.opensymphony.workflow.util.StatusCondition </arg> <arg name="status">Queued</arg> </condition> </conditions> </restrict-to> <pre-functions> <function type="class"> <arg name="class.name"> com.opensymphony.workflow.util.Caller </arg> </function> </pre-functions> <results> <unconditional-result old-status="Finished" status="Underway" step="1" owner="${caller}"/> </results> </action> <action id="2" name="Finish First Draft"> <restrict-to> <conditions type="AND"> <condition type="class"> <arg name="class.name"> com.opensymphony.workflow.util.StatusCondition </arg> <arg name="status">Underway</arg> </condition> <condition type="class"> <arg name="class.name"> com.opensymphony.workflow.util.AllowOwnerOnlyCondition </arg> </condition> </conditions> </restrict-to> <results> <unconditional-result old-status="Finished" status="Queued" step="2"/> </results> </action> </actions> </step> <step id="2" name="finished" /> </steps></workflow> 刚学hibernate遇到一个麻烦 spring连接多个数据源 求救:struts2<s:iterator/>问题,解决即给分! 高分求解(100),struts数据源的问题? Hibernate关于Restrictions.in的查询问题 用java怎么控制打印输出的内容! struts问题,问一下struts标签问题 深切同情我吧:总值超过5000升大米,于昨晚不幸遇难失窃 请如何传递一个数组? 关于hibernate中事物管理问题 struts中的session问题 急!!!!!!!!!100分谁来拿?
老兄能不能讲具体一点!
如果是你的xml文件并且就在newworkflow的目录下,那么试试:
id = wf.initialize("example.xml", 1, null);
老兄我现在把我的配制文件及相关代码详细列出请指点!谢谢!
我的开发环境为:
jbuilder9.0+jboss4.0
工程名为testworkflow.jpx
webapp(web应用程序名):
testworkflowweb
新建工作流:newworkflow.jsp代码:(登录时新建了用户放在session.getAttribute("username")中)
Workflow wf = new BasicWorkflow((String) session.getAttribute("username"));
DefaultConfiguration configs = new DefaultConfiguration();
wf.setConfiguration(configs);
id = wf.initialize("example",1, null);
out.print("得到工作流实例为:"+Long.toString(id)+"<br><br>");
osworkflow配置文件如下:
在 testworkflow\testworkflowweb\WEB-INF目录下有如下文件
1.workflows.xml
2.osworkflow.xml
3.example.xml
osworkflow.xml的内容:
<osworkflow>
<persistence class="com.opensymphony.workflow.spi.memory.MemoryWorkflowStore"/>
<factory class="com.opensymphony.workflow.loader.XMLWorkflowFactory">
<property key="resource" value="workflows.xml" />
</factory>
</osworkflow>workflows.xml的内容:
<workflows>
<workflow name="example" type="resource" location="example.xml"/>
</workflows>example.xml的内容:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow PUBLIC
"-//OpenSymphony Group//DTD OSWorkflow 2.7//EN"
"http://www.opensymphony.com/osworkflow/workflow_2_7.dtd">
<workflow>
<initial-actions>
<action id="1" name="Start Workflow">
<results>
<unconditional-result old-status="Finished" status="Queued" step="1"/>
</results>
</action>
</initial-actions>
<steps>
<step id="1" name="First Draft">
<actions>
<action id="1" name="Start First Draft">
<restrict-to>
<conditions>
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.StatusCondition
</arg>
<arg name="status">Queued</arg>
</condition>
</conditions>
</restrict-to>
<pre-functions>
<function type="class">
<arg name="class.name">
com.opensymphony.workflow.util.Caller
</arg>
</function>
</pre-functions>
<results>
<unconditional-result old-status="Finished" status="Underway"
step="1" owner="${caller}"/>
</results>
</action>
<action id="2" name="Finish First Draft">
<restrict-to>
<conditions type="AND">
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.StatusCondition
</arg>
<arg name="status">Underway</arg>
</condition>
<condition type="class">
<arg name="class.name">
com.opensymphony.workflow.util.AllowOwnerOnlyCondition
</arg>
</condition>
</conditions>
</restrict-to>
<results>
<unconditional-result old-status="Finished" status="Queued" step="2"/>
</results>
</action>
</actions>
</step>
<step id="2" name="finished" />
</steps>
</workflow>