06-29-2012 08:35 AM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
template="/WEB-INF/templates/template.xhtml">
<ui:define name="content">
<h1>List of deployed processes</h1>
<h:form>
<h:dataTable value="#{processDefinitionList}" var="v_process">
<h:column>
<f:facet name="header">Key</f:facet>
#{v_process.key}
</h:column>
<h:column>
<f:facet name="header">Name</f:facet>
#{v_process.name}
</h:column>
<h:column>
<f:facet name="header">Version</f:facet>
#{v_process.version}
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<h:outputLink value="#{formService.getStartFormData(v_process.id).formKey}">
Start
<f:param name="processDefinitionKey" value="#{v_process.key}"></f:param>
</h:outputLink>
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
package beans;
import java.util.List;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.inject.Named;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.ProcessDefinition;
/**
* backing bean for retrieving a list of processes
*
* @author meyerd
*/
@Named
@RequestScoped
public class ProcessList {
private String processDefinitionKey;
@Inject
private RepositoryService repositoryService;
@Produces
@Named("processDefinitionList")
public List<ProcessDefinition> getProcessDefinitionList() {
return repositoryService.createProcessDefinitionQuery()
.list();
}
public void setProcessDefinitionKey(String processDefinitionKey) {
System.out.println("settttt_________" +processDefinitionKey);
this.processDefinitionKey = processDefinitionKey;
}
public String getProcessDefinitionKey() {
System.out.println("gettttt_________" +processDefinitionKey);
return processDefinitionKey;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
template="/WEB-INF/templates/template.xhtml">
<ui:define name="metadata">
<f:metadata>
<!– bind the key of the process to be started –>
<f:viewParam name="processDefinitionKey" value="#{processList.processDefinitionKey}" />
</f:metadata>
</ui:define>
<ui:define name="content">
<h1>New Tweet</h1>
<h:form>
<table>
<tr>
<td>Your twitter account:</td>
<td><h:inputText value="#{processVariables['account']}" />
</td>
</tr>
<tr>
<td>Tweet content:</td>
<td><h:inputText value="#{processVariables['content']}" />
</td>
</tr>
<tr>
<td></td>
<td><h:commandButton value="Submit"
action="#{businessProcess.startProcessByKey(processList.processDefinitionKey)}" />
</td>
</tr>
</table>
</h:form>
</ui:define>
</ui:composition>
07-20-2012 06:17 AM
07-20-2012 06:29 AM
<ui:define name="metadata">
<f:metadata>
<!– bind the key of the process to be started –>
<f:viewParam name="processDefinitionKey" value="#{processList.processDefinitionKey}" />
</f:metadata>
</ui:define>It's rather JSF question than Activiti.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.