Process Flow Formatter - Can I have more than one formatter on a table/form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2012 07:34 AM
Hi,
I recently had a business requirement to add a second process flow formatter on the Project form. Currently we have a process flow for Project 'State' values. The new requirement is to add a second formatter with the 'Phase' values under the existing formatter for 'State'. Is this technically feasible?
Thank you,
Marcelo R. S. Correia
EMC Corporation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2012 10:19 AM
Without significant customization, unfortunately, it looks like that plugin will only allow one Process Flow formatter per form.
A custom solution would likely involve creating a modified copy of the process_flow UI Macro that pulled its data in a different way, and creating a Formatter that used the custom macro so it could be put on a form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2012 12:17 PM
Thank you CapaJC. I ended up duplicating the existing formatter and UI macro and I could add a second Formatter to the project form, also with 'state'. Now what I'm having trouble with is to change the UI Macro to get me the values from the 'phase' column instead of 'state' from the original UI Macro (process_flow UI Macro). I tried replacing 'state' and 'next_state' below by 'phase' and 'next_phase' on my duplicated UI Macro but that doesn't work. Is there any thoughts on how I could get 'phase' to work on my duplicated UI Macro?
td class="process_flow $[jvar_flow.getParameter('state')]" title="$[jvar_flow.getLabel()]"
src="images/chevron_$[jvar_flow.getParameter('state')]_$[jvar_flow.getParameter('next_state')].pngx"
Thank you,
Marcelo Correia
EMC Corporation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2012 12:57 PM
Hmm, this might be harder than you were expecting. Looks like parts of that existing plugin are hardcoded in Java. Specifically the code that creates the jvar_flow variable contents. That code queries for all sys_process_flow records for a table, orders them, compares their conditions to the current record, and returns the jvar_flow variables that have the information needed to render the process flow formatter.
In that code, jvar_flow.getParameter('state') is going to return a value of "past", "next_state" or "future", and they're only used in determining which colored chevron images to use between labels.
I think you're going to have to bypass that code altogether and render it yourself, based on arbitrary logic you provide in the macro. Specifically, the g2:flow_formatter tag will not be useful to you in your custom macro. You'll need to build your own td tags and specify the img you need between each.
I wish I had time to mock up an example. Hopefully someone can piggy back onto this and further it along?