Hi Chris,

I think this is most easily done by performing the checks in advance within the 
Java-Code of a command, and just injecting the result of the check into the 
workflow.
You could do this by extending the ActivationCommand or LaunchWorkflowCommand, 
or you could write a new command which you can call from the workflow.

If it is just the path you are using as a discriminator, then you don't really 
need to do any programming to solve this though. The workflow module already 
supports launching different workflows based on the path. So you could just 
create 2 versions of your workflow definition, one for Group A and another for 
Group B, and use the path-based configuration to pick the right one.

Regards from Vienna,

Richard



-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Christian Balaguer Jehle (via Magnolia Forums)
Gesendet: Montag, 05. November 2012 13:38
An: Magnolia User List
Betreff: [magnolia-user] Inject java class or value into workflow xml

Hi there

I'm looking for an easy way to somehow add if-statements to the workflow xml 
which check for the category of the current page and act upon it.

I'm imagining something like this:

[code]
    <if test="${categoryOfThisPage} == "/path/to/a/category">
      <to-myGroupA/>
    </if>
    <if test="${categoryOfThisPage} == "/path/to/another/category">
      <to-myGroupB/>
    </if>
[/code]

Is it possible to inject java classes into the context of this xml so I can 
call their methods?

Greetings, Chris.

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=d60747a7-0a77-4f57-99ce-09ec77d7d6e6


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------





----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to