AnsweredAssumed Answered

Externally Triggered State Transition

Question asked by wvictor on Oct 27, 2008

I'm creating a workflow that's started when a piece of custom content is created.:

-> Node creation: workflow started inside custom content creation bean using WorkflowService
-> External Java app modifies content (using web-service-client API) with new content from external source, attaching hadError aspect if some exception (unrelated to alfresco) occurred and replacing node content with some text describing the exception.
-> If no problems arise, the workflow should be ended at this point. If not, workflow should go into a review state where human interaction is required.

My question: What would be the best way to trigger this transition? Some possibilities I thought of:
1. make state transitions dependent on some property/aspect of the node that can be set by the external client (RepositoryServiceSoapBindingStub etc.).
2. have a state with some javascript that checks node aspects/properties/whatever and sets new state
3. use webscript that modifies the workflow state. script is executed by accessing some webscript url from external client once content/exception has been uploaded. (I would like to avoid this option…)
The first two options seem more elegant to me, but how do I get the workflow to move from one state to another without human interaction? Note: the solution should not involve any manual setup actions in the web client (such as setting up rules) that cannot be distributed as an extension (amp/zip/jar/etc.)

Any advice would be appreciated.