cancel
Showing results for 
Search instead for 
Did you mean: 

Customize Workflow UI

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

I want to show some extra information from a file in an advanced workflow. This extra information are stored in a database (not in the model, because there are a lot and the can be changed often by other applications).

What is the best way to show some extra information in a workflow? (when a user receive task to do, he can see this information)
I thought about to add a JSP in the jsp which shows the workflow (the page who user can press approve, reject, (/jsp/workflow/manage-task-dialog.jsp
) …) … but I don't know how to show it just for one Workflow. Or can I adding the link to the jsp (which get data from database) directly in the web-client-config.xml in the section of the action workflow ?
<config evaluator="node-type" condition="trucwf:derniereValidation"
      replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general"
            component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:description"
            component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
ADD SOME LINK TO A JSP?
      </property-sheet>
   </config>

Thanks Smiley Happy
8 REPLIES 8

jayjayecl
Confirmed Champ
Confirmed Champ
you'd better do the following :
- add a custom property to your task model "trucwf:derniereValidation", like "trucwf:myCustomProp"
- in the webclient-config-custom, add the following :

<show-property name="trucwf:myCustomProp" component-generator="myCustomPropGenerator" />

- edit your faces-config-custom.xml to bind this "myCustomPropGenerator" to a Java component.
- write this Java Component (for example "MyCustomPropGenerator.java") in order to suit your needs.

Writing a custom generator needs some good developing skills, but there will be no easy way to match your requirements.
For a better view of components and generator, browse the wiki to read about "Component framework", or have a look at Alfresco source code to see how basic generators are built

dranakan
Champ on-the-rise
Champ on-the-rise
Thank you JayJayECL Smiley Happy

I will try to indicate in the faces-config-custom.xml a custom.jsp, and in this custom.jsp call java class :

web-client-config.xml -> faces-config-custom.xml -> custom.jsp -> java class

But, can someone tell me what is the "Best practice" to call a java class from a jsp ?

    Just simple call (<%@page import="foo.pacakge.MyClass" %> …)
    Creation of a taglib
    …?
Thank you Smiley Happy

jayjayecl
Confirmed Champ
Confirmed Champ
I'm pretty sure this won't work.
I think you won't find a better way than the one I explained to do what you need

dranakan
Champ on-the-rise
Champ on-the-rise
JayJayECL said true… It's better to use directly the component.

To create this, follow : http://forums.alfresco.com/fr/viewtopic.php?f=16&t=1077  (or in english : http://forums.alfresco.com/en/viewtopic.php?t=6840)

In addition if someone use a module, it need to add the file "face-config.xml" in the jar : http://klungvik.com/index.php/2009/alfresco-the-first-lessons-learned/

mabayona
Champ on-the-rise
Champ on-the-rise
Instead of going down the long and windy road of java+JSF customisation, you could alternativey consider creating your own task model + custom properties + workflow and using Javascript actions asociated with workflow transitions to move information between the task and repository.

See:

http://wiki.alfresco.com/wiki/WorkflowAdministration#Step_2:_Create_the_Task_Model

for details.

In my opinion it is far easier and could very well fit with your requirements.

jayjayecl
Confirmed Champ
Confirmed Champ
I sincerely recommend not to use workflow script actions to handle complex goals.

As he said, there is an external DB
I want to show some extra information from a file in an advanced workflow. This extra information are stored in a database

But, I will agree with yuo on that point :
maybe it's a little tricky and hard to develop a custom JSF component. Instead of doing scripting in transitions or node events, he could call some actions (Java classes) that would retrieve the data stored in the external DB, and put whatever he needs to in the executionContext (and then, in some further task properties)

dranakan
Champ on-the-rise
Champ on-the-rise
I can do what I want with the components… but I failed to find goods documentation about this… Have you a good link ?

For example something which show how to use a component to produce a list…

Thanks Smiley Happy

jayjayecl
Confirmed Champ
Confirmed Champ
Hi, have a look at this article :

http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/

and have a look at the source code of TextFieldGenerator, you'll have a better idea