0 Replies Latest reply on Jun 12, 2008 4:56 AM by ms_shitole

    How do I solve database issues with JSF frameworks

      Hi,

      As JBPM is such a nice workflow engine...As we are working from last 6 months. We got very a very good suceess while working with jbpm. As security is one of the concern in Jbpm but we solved security part and added the user mapping also.

      Now we wana do the presentation part where we are not geting the concept of JSF framework which was used in JBPM. As our requirement is that, we will add our own tables in the databse containing employee informations, library etc.

      For example we created one "HolidayRequest" process definition. And the forms(xhtml) which are related to this process, Inside these xhtml forms, we need to retrieve data from the database and wanted to show dynamically.

      And we got one such example of doing so but it is not working with our forms(In our personal process related forms)
      In "jbpm-console.war" file contains one "sa" named folder. Inside "sa" folder, all xhtml files are present . One of them is t_task.xhtml, I will give u code of t_tasks.xhtml. The exact same thing I want to do in my own "HolidayRequest" process forms(form.leaveApplication.xhtml) retrieve from database and display same like t_tasks.xhtml....

      Code of t_tasks.xhtml file-(Not full code, only data retrieval & diplay code)
      <h:outputText>
      <ga:attribute name="rendered" value="#{! empty tasks}"/>

      <gd:repeat value="#{tasks}" var="task" idVar="rid" first="#{tasks_pager.first}" limit="#{tasks_pager.limit}">
      <gs:tr rendered="#{((request.remoteUser == task.loggedUser)||(request.remoteUser == 'manager')||(request.remoteUser == task.actorId)) ? true : false }">
      <ga:attribute name="styleClass" value="#{rid % 2 == 0 ? 'odd' : 'even'}"/>

      <h:outputText value="#{task.id}"/>


      <h:outputText value="#{task.name}"/>


      <ga:responseActions>
      <gd:sort source="#{task.pooledActors}" target="#{taskActors}" entryVar="e" argument="#{e.actorId}"/>
      </ga:responseActions>
      <h:form>
      <gd:repeat>
      <ga:attribute name="value" value="#{taskActors}"/>
      <ga:attribute name="var" value="actor"/>
      <ga:attribute name="rendered" value="#{! empty task.pooledActors}"/>
      <h:outputText value="#{actor.actorId}"/>
      <ga:checkRole roles="#{access.role.task}">
      <h:outputText value=" - " rendered="#{task.end == null and task.actorId != actor.actorId}"/>
      <h:commandLink rendered="#{task.end == null and task.actorId != actor.actorId}">
      <f:param name="xtaskId" value="#{task.id}"/>
      <f:param name="xactorId" value="#{actor.actorId}"/>
      <ga:parameter name="xtaskId" target="#{xtaskId}"/>
      <ga:parameter name="xactorId" target="#{xactorId}"/>
      <ga:attribute name="value" value="#{task.actorId == null ? 'Assign' : 'Reassign'}"/>
      <j4j:loadTask id="#{xtaskId}" target="#{xtask}"/>
      <j4j:assignTask task="#{xtask}" actorId="#{xactorId}"/>
      <n:nav outcome="success" redirect="true" storeMessages="true"/>
      <n:nav outcome="error" redirect="true" storeMessages="true"/>
      </h:commandLink>
      </ga:checkRole>

      </gd:repeat>
      </h:form>


      <h:outputText value="#{task.actorId}"/>


      However procins.xhtml file contains
      <j4j:listTasksForProcessInstance unless="#{viewMode != 'task'}" target="#{tasks}" processInstance="#{pi}"/>

      this tag is for retrieving data and storing in "{#tasks}" collection object.


      So how we could achieve this? please guide us. I will be highly grateful to you.

      Thanking you
      --Mansingh