|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
MySQLWorkflowStore...first stepsHello everybody,
I use osworkflow in a swing standalone applications with MySql database; I've tried configure "osworkflow.xml" for using "MySQLWorkflowStore"; This is the file: [CODE] <osworkflow> <persistence class="com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStore"> <!-- For jdbc persistence, all are required. --> <property key="datasource" value="jdbc/DefaultDS"/> <property key="entry.sequence.increment" value="INSERT INTO OS_ENTRYIDS (ID) values (null)"/> <property key="entry.sequence.retrieve" value="SELECT max(ID) FROM OS_ENTRYIDS"/> <property key="entry.table" value="OS_WFENTRY"/> <property key="entry.id" value="ID"/> <property key="entry.name" value="NAME"/> <property key="entry.state" value="STATE"/> <property key="step.sequence.increment" value="INSERT INTO OS_STEPIDS (ID) values (null)"/> <property key="step.sequence.retrieve" value="SELECT max(ID) FROM OS_STEPIDS"/> <property key="history.table" value="OS_HISTORYSTEP"/> <property key="current.table" value="OS_CURRENTSTEP"/> <property key="historyPrev.table" value="OS_HISTORYSTEP_PREV"/> <property key="currentPrev.table" value="OS_CURRENTSTEP_PREV"/> <property key="step.id" value="ID"/> <property key="step.entryId" value="ENTRY_ID"/> <property key="step.stepId" value="STEP_ID"/> <property key="step.actionId" value="ACTION_ID"/> <property key="step.owner" value="OWNER"/> <property key="step.caller" value="CALLER"/> <property key="step.startDate" value="START_DATE"/> <property key="step.finishDate" value="FINISH_DATE"/> <property key="step.dueDate" value="DUE_DATE"/> <property key="step.status" value="STATUS"/> <property key="step.previousId" value="PREVIOUS_ID"/> </persistence> <factory class="com.opensymphony.workflow.loader.XMLWorkflowFactory"> <property key="resource" value="workflows.xml" /> </factory> </osworkflow> [/CODE] In Main.java I've the follow row code: [CODE] MySQLWorkflowStore store = new MySQLWorkflowStore(); long workflowId=-1; String nomeWorkflow="Controlla qualita"; workflow=new BasicWorkflow("test"); Configuration conf = new DefaultConfiguration(); workflow.setConfiguration(conf); try{ workflowId=workflow.initialize(nomeWorkflow,1, null); }catch(Exception e){ e.printStackTrace(); } [/CODE] But this exception is cacthed: [CODE] com.opensymphony.workflow.StoreException: Error looking up DataSource at jdbc/DefaultDS: root cause: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial [/CODE] Anyone can help me please? --------------------------------------------------------------------- Posted via Jive Forums http://forums.opensymphony.com/thread.jspa?threadID=414005&messageID=501642#501642 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: MySQLWorkflowStore...first stepsBy default ,it looks like that oswf find the datasource from jndi, you can also view the source of class mysqlworkflowstore, i think that you can extends this class and mofidy to your own way to get the datasource,ofcouse if your app can register a datasource to jndi ,you must ensure that work correctlly,by the way ,jndi is part of jee ,can you ever be farmily with it !
--------------------------------------------------------------------- Posted via Jive Forums http://forums.opensymphony.com/thread.jspa?threadID=414005&messageID=502899#502899 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: MySQLWorkflowStore...first stepsUnfortunately the JDBCWorkflowStore, from which MySQLWorkflowStore is derived, requires a JNDI DataSource.
If you do not have JNDI available and you are using the Spring Framework, you could use the org.springframework.mock.jndi package to simulate JNDI within your application context. If you are not using Spring you could probably download the source and examine the package to determine how how the package is implemented and duplicate it in your application. You can also checkout MockEJB for an in-memory JNDI implementation. Both of the above packages where created for testing purpose but there is no reason they can't be used for other purposes. You may need to harden them to make them more reliable but they should work fine. If you can get an in-memory JNDI setup you can use your config without any changes. --------------------------------------------------------------------- Posted via Jive Forums http://forums.opensymphony.com/thread.jspa?threadID=414005&messageID=503937#503937 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: MySQLWorkflowStore...first stepsCompletely forgot about this one. Simple-JNDI @ http://www.osjava.org/simple-jndi/ was designed for in-memory use.
--------------------------------------------------------------------- Posted via Jive Forums http://forums.opensymphony.com/thread.jspa?threadID=414005&messageID=503938#503938 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
| Free Forum Powered by Nabble | Forum Help |