11 Replies Latest reply on Oct 25, 2008 7:06 AM by kukeltje

    Different processes should be able to use different styleshe

    jwooten

      We've modified the jbpm console to be a little cleaner ( 3.2.2 ) and making progress. However, I find that I want different business processes to use different stylesheets. It appears that the stylesheets located in the console e.g. link href="../us/stylesheet.css"
      are available in pages referred to under forms.xml in each process, BUT I can't find a way to package a set of stylesheets with the process and refer to them. Links seem to be always relative to the path to the running console.

      It makes absolutely no sense to have to restart the server to change a stylesheet for an individual process that is deployed. So, how do I include the stylesheets with a process AND refer to them in the <link tag for a particular form? Is there a special tag that looks them up relative to the name of the process?

      Thanks!

        • 1. Re: Different processes should be able to use different styl
          kukeltje

          The console is not realy ment to be used this way, so you won't find anything special for this. The console is an admin and rad thing, not an end-user application

          • 2. Re: Different processes should be able to use different styl
            jwooten

            I'm having problems with every question that people trying to learn ask being answered with "You're not supposed to use the console this way".

            Duhh,
            It is a tool to deploy processes and learn how to use them isn't it?
            Yes, it is NOT an end user application, but that doesn't answer the question.

            The question was ( I repeat it since it obviously wasn't read ), "How do you package different style sheets with different processes?"

            Now, the fact that they are deployed into the jbpm-console or into a custom application which manages several different processes doesn't change the fact that I can't seem to create a url for the stylesheets that are in my process.

            If someone would look beyond the fact that some of us are struggling with the jbpm-console and think about what we're asking, perhaps there is a very simple answer like, "use a url like href='/processname/stylesheets/style.css'"
            or such. How else can we have different style sheets in different processes?

            Would appreciate a thoughtful answer instead of a flippant one that gives no useful information.

            • 3. Re: Different processes should be able to use different styl
              jbarrez

              woo37830, Reacting like that will get you only no answers.

              I will give you my opinion nontheless:

              What you want is conceptually wrong: a process should not have to know anything about how it will be shown in the front-end. It is as if you would store stylesheet urls in your Hibernate domain models.

              If you do want to follow that path, I would suggest storing the url as a process variable... but as I said that's bad practice: if the front-end needs to change you'll need a redeployment of your processes. You don't edit your database schema when you change your front-end, do you?

              • 4. Re: Different processes should be able to use different styl
                kukeltje

                 

                "woo37830" wrote:
                It is a tool to deploy processes and learn how to use them isn't it?

                Yes

                "woo37830" wrote:

                Yes, it is NOT an end user application, but that doesn't answer the question.

                Correct

                "woo37830" wrote:

                The question was ( I repeat it since it obviously wasn't read ), "How do you package different style sheets with different processes?"


                Ok, my bad. The answer "so you won't find anything special for this." was not clear. Should it have been:
                - You can't out of the box?
                - Build something creatively yourself?
                - Maybe someone else did something like this and they might respond here

                "woo37830" wrote:

                If someone would look beyond the fact that some of us are struggling with the jbpm-console and think about what we're asking

                Why do you think I didn't? Because you did not get the answer you want? I can struggle to get a nail into my wall with a screwdriver, or I can use a hammer. (thought of something like going to Australia and struggle with a crocodile to get leather for new shoes or something, but could not find the right analogy). Point is, use tools what they were meant to be used for.

                "woo37830" wrote:

                perhaps there is a very simple answer like, "use a url like href='/processname/stylesheets/style.css'"
                or such.

                If there was I would have told you, why wouldn't I?.... believe me

                "woo37830" wrote:

                How else can we have different style sheets in different processes?

                By building your own webapp and using look-and-feel in there.

                "woo37830" wrote:

                Would appreciate a thoughtful answer instead of a flippant one that gives no useful information.

                Again, not the information you wanted.... no complete out of the box solution.... your boss or marketing department is probably pushing this requirement right? And you have no time to develop your own application right? Believe me, they can (and will, I speak from experience) come up with more requirements that the console cannot and will not fulfil.

                Oh and remember we love you (for those who know their classics)

                • 5. Re: Different processes should be able to use different styl
                  jwooten

                  Sorry for flame! Frustrated and shouldn't take it out on others. You're a better person than I am ;-) Thanks for the calm reply and attempt to help.

                  Here is the problem:

                  1) Customer wants to see a demo of having one "console" where we run several business processes from different departments, e.g. HR, Payroll, Benefits, etc.

                  2) People in various roles will receive email notifications when things are posted to their "queues" and have a link that takes them to the "console" as a user. Not necessarily the jbpm-console, but a single "console" with branding on the header for the "company" and a consistent way of handling logins, showing and manipulating the task lists, where all processes use the same task list ( with the process name showing ).

                  3) The various departments want their business processes to have different style sheets for their "tasks" only. Not affecting the header of the "console", nor the "footer", nor the administrative (usually hidden) left menu, but only their "pages".

                  4) So HR wants a blue theme with HR at the top of the "task" page and a particular layout, Benefits wants an orange theme with tabbed pages in their "tasks".

                  5) I've done this before in work-flow applications I've built, but used jsps and knew the url of the different processes relative to the root of the work-flow tool. E.g. href="../../Benefits/stylesheets/style1.css".

                  6) I have not been able to figure out where the xhtml pages actually reside when a process is loaded into the console, and thus don't know how to locate a particular style sheet. In the xhtml page, I need to put some
                  kind of href="...." path to the style sheet. I suppose I could set up a separate static page url on the same server and do href="ip.address:8080/Resources/Benefits/styles/style1.css" and put things like that there for retrieval. I could also put href="ip.address:8080/Resources/Benefits/images/image1.jpg" etc.
                  What do you think of that idea?

                  Thanks again. Trying to use some very nice technology but with very little to go on.

                  • 6. Re: Different processes should be able to use different styl
                    jwooten

                    I implemented the idea of a separate webapp that just holds the resources for various processes as I described previously. I structured it as deploy/default/resources.war/BCL/stylesheets/stylesheet1.css, deploy/default/resources.war/BCL/images/image1.jpg, etc. where BCL is the name of a process. In the stylesheets, I do the link with <link href="http://ip.address/resources/#{process.name}/stylesheets/stylesheet1.css"../>

                    It works great!

                    I can have separate image files for each process, separate stylesheets, includes, etc.

                    • 7. Re: Different processes should be able to use different styl
                      salaboy21

                      I think (and I supose) that this is a very extreme solution. Why don't you use some kind of If sentence that ask the name of the process, or the department in the company and then find the correct style sheets? In this approach the if is the only logic that you need, why use another webapps, and have absolute links..

                      I think if you can solve your problem is ok.. but i don't suggest this approach for something in a production environment.

                      • 8. Re: Different processes should be able to use different styl
                        kukeltje

                        Maurico,

                        I think that is what he does (we've done the same). A separate webapp with a generic tasklist and if forms are opened (self designed in jsf, not console forms) a specific layout appears. This can even be done in the console froms. But then you still have the 'wrapper'

                        • 9. Re: Different processes should be able to use different styl
                          salaboy21

                          Ronald
                          I'm saying that use 2 applications sounds odd to me.. my proposal is
                          1) Use the console and customize it (i never recommend this option)
                          2) Write a new application that use the APIs to fulfill the requirements..

                          I think we both are saying the same...

                          • 10. Re: Different processes should be able to use different styl
                            jwooten

                            Not sure what is meant by an if sentence. Do we mean that in the jsf, we have an if clause, get the name of the process, and then how do we locate the correct stylesheets that are packaged and deployed with the process? what i did works, but you have to separately manage the stylesheets and images.

                            Agree it's clumsy, just don't know another way to manage stylesheets and images.

                            • 11. Re: Different processes should be able to use different styl
                              kukeltje

                              via a resource servlet and have the servlet, based on a process name, load the images and stylesheets from somewhere (you can even package them e.g. in the processarchive)