Andreas Hartmann wrote:
Jörn Nettingsmeier schrieb:
Andreas Hartmann wrote:
Jörn Nettingsmeier schrieb:
Should the creation of a document require a workflow transition?

i did not talk about a transition, but a default state.

The versions are bound to transitions, not to states. I.e., a
version is only created when a transition is executed.

well, no need to change that. just extend this definition with "...or when the document is initially created." just one local change in the default document creator.

and, um, creation is a transition from non-being into being. all nice and constistent. (/me runs and hides)

:)

http://en.wikipedia.org/wiki/Deterministic_finite_state_machine

T : S × Σ → S

(if the Unicode doesn't make it: T : S x Sigma -> S)

But that's just a detail, the actual change doesn't affect the
state machine (it's just about internal version storage).

[...]

* someone edits it, and the workflow implementation figures, hey, someone is editing it, let's initiate a state transistion. oh wait, there is no state yet.

No, it is in the initial state.

i see. but that's even nicer. then nothing at all has to change in the workflow implementation. only the document creator has to be extended to create a state in it (which has to be the one with initial="true" in the workflow.xml of the document module). or am i missing something?

It's even easier. With the current implementation, the document is
automatically in the initial state. It just doesn't have a version
entry, which means the same. What we want instead is a version entry
which should be added automatically when a document is created, e.g.
the DocumentManagerImpl should invoke some initialize() method on
the DocumentWorkflowable. This doesn't change anything to the fact
that the document is in the initial workflow state, but it adds the
information when and who by [1] it was created.

i tried to implement this by calling

WorkflowUtil.invoke(this.manager,
    getSession(),
    getLogger(),
    getSourceDocument(),
    "create");

in the doExecute() method of src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java, but i'm told that

org.apache.lenya.workflow.WorkflowException: The event [create] cannot be invoked on the document [EMAIL PROTECTED] at org.apache.lenya.workflow.impl.WorkflowManagerImpl.invoke(WorkflowManagerImpl.java:56) at org.apache.lenya.workflow.impl.WorkflowManagerImpl.invoke(WorkflowManagerImpl.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


ok, so this is probably not the correct approach. i made up the "create" event to see what would happen - do i have to declare events somewhere? or maybe i should not call the WorkflowUtil helper but rather create a newVersion directly?

can anyone give me a hint (or better yet, fix it:) ?

thanks,

jörn


--
"Open source takes the bullshit out of software."
        - Charles Ferguson on TechnologyReview.com

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: [EMAIL PROTECTED], Telefon: 0203/379-2736

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to