How-to trigger a workflow using the Public API: compariso...
Versions Compared
Old Version 15
changes.mady.by.user Ricardo Correia
Saved on Jun 26, 2013
compared with
New Version 16
changes.mady.by.user Ricardo Correia
Saved on Jun 26, 2013
- Previous Change: Difference between versions 14 and 15
- Next Change: Difference between versions 16 and 17
- View Page History
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment: Formatting changes.
...
First, a method must be used to obtain a legacy kernel. This can be used, given that getContainer() returns the Symfony Dependency Injection Container:
...
| 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. Legacy code also requires a user By default, code in LegacyKernel::runCallback() calls is executed as anonymous. You'll have to log the executing user manually on legacy as well.
|
...
Comments
Add a comment