How to initialize PersistentScottyEngine properly?

86 views
Skip to first unread message

Eugene Dzhurinsky

unread,
Oct 3, 2016, 3:10:07 PM10/3/16
to COPPER Engine
Hello! I'm struggling with getting the persistent workflows up. I write couple of tests using the transient workflow engine and everything went well. However once I change the workflow implementation to something PersistentScottyEngine - the workflows don't seem to be executed at all.

    val factory = new PersistentScottyEngine()


    val txnController
= new CopperTransactionController()
    txnController
.setDataSource(ds)


    val processorPoolManager
= new DefaultProcessorPoolManager[PersistentProcessorPool]()
    val processorPool
: PersistentPriorityProcessorPool = new PersistentPriorityProcessorPool("MAIN", txnController)
    processorPoolManager
.addProcessorPool(processorPool)


    val dbStorage
= new ScottyDBStorage()
    dbStorage
.setDialect(new PostgreSQLDialect())
    dbStorage
.setTransactionController(txnController)


    factory
.setDependencyInjector(context)
    factory
.setWfRepository(wfRepo)
    factory
.setProcessorPoolManager(processorPoolManager)
    factory
.setDbStorage(dbStorage)
    factory
.setIdFactory(new JdkRandomUUIDFactory())


    factory
.startup()
    processorPoolManager
.startup()
    processorPool
.startup()


This is how I create the engine to feed the workflows into it. Perhaps I am missing something?

Thanks!

Michael Austermann

unread,
Oct 4, 2016, 2:22:19 AM10/4/16
to copper...@googlegroups.com
Try using org.copperengine.core.persistent.PersistentProcessorPool.DEFAULT_POOL_ID as name for the processor pool.
Or launch the workflow instances in processor pool "MAIN" using org.copperengine.core.ProcessingEngine.run(WorkflowInstanceDescr<?>) with WorkflowInstanceDescr.processorPoolId="MAIN".

I suggest using org.copperengine.ext.persistent.RdbmsEngineFactory for creating the copper engine, instead of creating and injecting all copper components by yourself.
At least for the common case this should work fine.


Von: "Eugene Dzhurinsky" <jdev...@gmail.com>
An: "COPPER Engine" <copper...@googlegroups.com>
Gesendet: Montag, 3. Oktober 2016 21:10:07
Betreff: [COPPER Users] How to initialize PersistentScottyEngine properly?

--
You received this message because you are subscribed to the Google Groups "COPPER Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to copper-engin...@googlegroups.com.
To post to this group, send email to copper...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/copper-engine/c579f36f-a912-4321-a8fe-604798e9b0e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eugene Dzhurinsky

unread,
Oct 4, 2016, 2:35:21 PM10/4/16
to COPPER Engine, michael.a...@scoop-software.de
Michael, thanks for the response! I nailed down the problem - it was because some properties of the workflow class I've passed to the persistent engine - were not serializable, hence it failed with an exception internally. The sad thing is that the exception is reported via DEBUG level, so in the real life you know that your workflow doesn't work - but no clue why.

Michael Austermann

unread,
Oct 4, 2016, 2:55:12 PM10/4/16
to COPPER Engine
Please send me the exception stack trace and I will have a look on that.


Von: "Eugene Dzhurinsky" <jdev...@gmail.com>
An: "COPPER Engine" <copper...@googlegroups.com>
CC: "michael austermann" <michael.a...@scoop-software.de>
Gesendet: Dienstag, 4. Oktober 2016 20:35:21
Betreff: Re: [COPPER Users] How to initialize PersistentScottyEngine properly?
Reply all
Reply to author
Forward
0 new messages