Custom workflow action

We have a requirement to invoke a bunch of workflow actions when a item transitions to Public state.

Since there is a limitation, we can invoke only one Out of the box workflow action at a time, I was thinking to write a custom workflow action which would internally invoke each one of those actions(eg PSTouchParentItems, PSOPublishContent etc) sequentially.

Do we have to configure any properties file or XML file to configure the custom workflow action to invoke each of the in built custom , and if so can you please tell us what files need to be setup.

Also correct me, basically I would be writing a new class that extends PSDefaultExtension and implements IPSWorkflowAction. Then I need to register in Extensions.xml. Is this correct?

thanks
Manvinder

In the PSO Toolkit, I saw a class: PSOWFActionDispatcher. This class requires the properties file:“dispatcher.properties” to work.
I donot see any sample or format for this property file.

Is there any way someone can please post a sample dispatcher.properties file or point me to relevant documentation so I can build this file?

I recommend you use the PSOSpringWorkflowActionDispatcher instead.

The required XML format is documented in the Javadoc for the PSOWFActionService.

The javadoc for PSOWFActionService class says:
"A sample file can be found at /WEB-INF/config/user/spring/PSOSpringWorkflowActionDispatcher-beans.xml "

Currently, I am using PSO Toolkit 6.6, and Rhythymx 6.6. I searched in both the places, I could not find any sample file named: PSOSpringWorkflowActionDispatcher-beans.xml. Or should I be looking somewhere else?

Also I believe all that we need to do is to configure this XML file, and there is NO need to setup dispatcher.properties file. Is this correct?

[QUOTE=manvinder12;11345]The javadoc for PSOWFActionService class says:
"A sample file can be found at /WEB-INF/config/user/spring/PSOSpringWorkflowActionDispatcher-beans.xml "
[/QUOTE]
Actually, everything you need is right there. Look at the sample XML provided in the Javadoc, it tells you what you need to know.

[QUOTE=manvinder12;11345]
Also I believe all that we need to do is to configure this XML file, and there is NO need to setup dispatcher.properties file. Is this correct?[/QUOTE]

Well, you need also to add the workflow action to the transition, but other than that, the XML file is enough. The dispatcher.properties file is not needed.

I am sorry…asking you another very basic question. Since this xml file: PSOSpringWorkflowActionDispatcher-beans.xml is not anywhere in the location you specified, do I simply create a new XML file and add the configuration to it:

<bean id=“psoWFActionService” class=“com.percussion.pso.workflow.PSOWFActionService” init-method=“init”>
</bean>

If so, is there any other configuration we would need to update for this new configuration file?

thanks
Manvinder

Your last post contained unescaped XML (and therefore I cannot read it).

The file IS there. You’re just not looking in the right place. There are 2 copies:

  1. In the “Deploy” directory for the PSOToolkit, where you unzipped the distribution file:

/Deploy/WEB-INF/config/user/spring/PSOSpringWorkflowActionDispatcher-beans.xml

  1. In the server’s directory:

/Rhythmyx/AppServer/server/rx/deploy/rxapp.ear/rxapp.war/WEB-INF/config/user/spring/PSOSpringWorkflowActionDispatcher-beans.xml.

Both of these are RELATIVE to the location where the PSOToolkit was unzipped or the Rhythmyx server was installed. You will see that the deploy.xml copies file #1 to the location specified by #2.

There is nothing in the file except the psoWFActionService bean and the required xml headers and namespace definitions.

Thank Dave…I found the files now…

Hi Dave,

I am getting the attached error when I try to transition an item from QuickEdit state to ‘Return to Public’.

I have attached the configuration file that I have created and used. For now, all that I am trying to test is just one single action: PSOPublishContent. I will add other actions later once I get past this error.

thanks
Manvinder

Look at your logs again. The actual error occurs during initialization.

The class PSOSpringWorkflowActionDispatcher does not support a property named “transitionActions”, You need to remove the bean named “psoSpringWorkflowActionDispatcher” from your configuration.

Dave

Hi Dave,

I am getting null pointer exception. Following are the attributes that I am trying to substitute:

For Workflow1, I put the Name of the workflow.
For transition1, I put the Label field value for the Transition.
And for action1, I put the value that we see in workflow Action drop down.
Also I am attaching the updated XML file that I am using.

Following is the error I am getting:
2009-08-17 00:01:32,503 ERROR [PSOSpringWorkflowActionDispatcher] unknown error null
java.lang.NullPointerException
at com.percussion.pso.workflow.PSOWFActionService.getActions(PSOWFActionService.java:172)
at com.percussion.pso.workflow.PSOSpringWorkflowActionDispatcher.performAction(PSOSpringWorkflowActionDispatcher.java:77)
at com.percussion.workflow.PSExecuteWorkflowActions.processResultDocument(Unknown Source)
at com.percussion.data.PSExtensionRunner.processResultDoc(Unknown Source)
at com.percussion.data.wb.runPostProcessingExtensions(Unknown Source)
at com.percussion.data.wb.runPostProcessingExtensions(Unknown Source)
at com.percussion.cms.handlers.PSWorkflowCommandHandler.o00000(Unknown Source)
at com.percussion.cms.handlers.PSWorkflowCommandHandler.processRequest(Unknown Source)
at com.percussion.cms.handlers.PSContentEditorHandler.processRequest(Unknown Source)
at com.percussion.server.PSApplicationHandler.processRequest(Unknown Source)
at com.percussion.servlets.PSAppServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.percussion.webdav.PSWebDavRequestFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.percussion.servlets.PSSecurityFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.percussion.servlets.PSCharacterSetFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)

As you said earlier, I still believe something is missing in my XML configuration, because this is a pure Out of the box configuration. I am yet to configure any of my custom actions. This problem is happening even for adding just one action PSOPublish itself.

thanks
Manvinder

Also once again, the error in XML format that is displayed on the Percussion page is attached.

thanks
Manvinder

The error you are getting (NPE at line 172 of PSOWFActionService.java) is only possible if you have NO transition actions defined in the configuration (that is, the map is null).

The config file you sent does have a transition action defined, so something doesn’t add up here. Either you have the config file in the wrong place, or you sent me the wrong config file.

Dave

Thanks Dave,
I think I was able to figure out the problem.

Do we need to restart the server everytime we update the configuration file
PSOSpringWorkflowActionDispatcher-beans.xml?

thanks
Manvinder

Yes, any time you modify any of the beans files, you must restart the server for the change to take effect.