How-to trigger a workflow using the Public API: compariso...
Versions Compared
Old Version 7
changes.mady.by.user Bertrand Dunogier
Saved on May 23, 2013
compared with
New Version 8
changes.mady.by.user Bertrand Dunogier
Saved on May 23, 2013
- Previous Change: Difference between versions 6 and 7
- Next Change: Difference between versions 8 and 9
- View Page History
Key
- This line was added.
- This line was removed.
- Formatting was changed.
...
| Note | |||||||
|---|---|---|---|---|---|---|---|
|
|||||||
| Public API code is always executed as a user, by default anonymous. Since workflows are often user dependent (Approval is), it is important that this code is executed as an editor, or as a user who will trigger the workflow.
Of course, this isn't required when using Public API code in controllers, since those will use the currently-logged in user. |
Data compatibility and workflow collaboration
Content created using the Public API does appear as expected in the dashboard, and the draft can be checked from here. Collaboration options from the backoffice are available, and the object's lifecycle can be managed the way it used to with Exponential 4.x.
Test script
The code below is a working Command script example that demonstrates the workaround. Just drop it in a bundle and update the namespace: https://gist.github.com/bdunogier/e05ed564770fa6a51e51
Comments
Add a comment