Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: ('Could not adapt', Process('sample'), <InterfaceClass shoobx.wfmc.interfaces.IPythonExpressionEvaluator>) #4

Open
zopyx opened this issue Apr 27, 2018 · 4 comments

Comments

@zopyx
Copy link

zopyx commented Apr 27, 2018

persistent==4.2.4.2
shoobx.wfmc==4.1.1
zope.cachedescriptors==4.3.1
zope.component==4.4.1
zope.event==4.3.0
zope.interface==4.5.0

from shoobx.wfmc import process

pd = process.ProcessDefinition('sample')

pd.defineActivities(
    author  = process.ActivityDefinition(),
    review  = process.ActivityDefinition(),
    publish = process.ActivityDefinition(),
    reject  = process.ActivityDefinition(),
)


pd.defineTransitions(
    process.TransitionDefinition('author', 'review'),
    process.TransitionDefinition('review', 'publish'),
    process.TransitionDefinition('review', 'reject'),
)

import zope.component
from shoobx.wfmc.process import StaticProcessDefinitionFactory
pdfactory = StaticProcessDefinitionFactory()
zope.component.provideUtility(pdfactory)
pdfactory.register(pd)


def log_workflow(event):
    print (event)
import zope.event
zope.event.subscribers.append(log_workflow)


proc = pd()

proc.start()
Traceback (most recent call last):
  File "test.py", line 34, in <module>
    proc.start()
  File "/Users/ajung/src/shoobx.wfmc/lib/python3.6/site-packages/shoobx/wfmc/process.py", line 666, in start
    evaluator = interfaces.IPythonExpressionEvaluator(self)
TypeError: ('Could not adapt', Process('sample'), <InterfaceClass shoobx.wfmc.interfaces.IPythonExpressionEvaluator>)

@agroszer
Copy link
Member

oops you need to register

<adapter 
    for="shoobx.wfmc.interfaces.IProcess"
    factory="shoobx.wfmc.process.PythonExpressionEvaluator" />

don't know why the repo is missing zcml

@zopyx
Copy link
Author

zopyx commented Apr 27, 2018

Also missing the release...I wonder why the tests pass with tox

@agroszer
Copy link
Member

what do you mean with "Also missing the release" ?

@zopyx
Copy link
Author

zopyx commented Apr 27, 2018

I installed the package first from PyPI and received the error above. Then I rechecked with a fresh checkout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants