Thursday, June 27, 2013

New features Of Jbpm v6


JBoss is going to launch new jbpm v6 in couple of  month.Jboss has already launch jbpm v6.0 Beta2 version.
Jbpm v6 is come with lots of new features.
Jbpm-console:
JBoss team has designed new jbpm-console that a new Web based management console.
It’s look cool compare to old one.










Using Jbpm-console:
-User-friendly UI, so System analyst and Manager can access and designing business process easily
-You can start process instances at any time
-You can create New project,New business process.
-You can view the status of process.
-You will get new task ui.
-New process instance management ui.
-Provide a configurable and pluggable workspace based on UberFire.




You can view Task list by calendar


-Runtime Manager
-New Guvnor Repository

 Dashboard Web Application:


This is a new component provided in jbpm v6.It’s a excellent feature.
Using Dashboard web application, you can see the reports of each process.
You can generate report by user also.
You can also monitor your system by using this web application.
Charts and allows users to define their own custom reports

Following New features will be included in Jbpm v6.x(According to Jboss):
Extend BPMN 2.0 support: We will continue to extend our support for BPMN 2.0 constructs by adding implementations for constructs that might still be missing.  We are currently focusing on the "Common Executable" subclass (as defined in the specification) with a few extension, as the short term target set.
Data Modeler: the ability to model your data in a web-based, business-user-friendly application, so it can be used in your processes later.
Form builder: a web-based form builder for creating task and process forms that will be shown to the user to show and/or request data.
"No code" tooling: the ability for business users to create, deploy, execute and monitor their processes without having to write any code.
Dynamic processes: the ability to dynamically change running process instances, add tasks on the fly, etc.

The jBPM and mobile: UIs targeted to mobile users to participate in processes (task lists, etc.), monitor running processes, etc.
Case management: The ability to track and execute business logic without up-front process modeling, the case is built and managed on the fly
Process instance migration tool: a tool to migrate running process instances to a newer process definition, including diff management and graphical support
Process analysis and process mining: analyzing processes to detect issues or optimizations, or discover / improve processes based on history information, etc.
Goal-driven BPM: instead of modeling processes as a sequence of steps, focus more on goals and preconditions, where the resulting process can almost be generated based on these.

Monday, June 10, 2013

create strut portlet in liferay

Create a Struts Portlet in Liferay
Step 1)Create a struts portlet






Step 2) put this jar file into the lib folder
commons-digester-1.8.jar
portals-bridges-common-1.0.jar
portals-bridges-struts-1.2.7-1.0.jar


Step 3) open liferay-plugin-package.properties file ,here you can add portal dependencies jar file
portal-dependency-jars=\
antlr2.jar,\
antlr3.jar,\
aopalliance.jar,\
asm-commons.jar,\
commons-beanutils.jar,\
commons-codec.jar,\
asm-util.jar,\
asm-xml.jar,\
asm.jar,\
struts-el.jar,\
struts.jar,\
commons-validator.jar
portal-dependency-tlds=\
liferay-portlet.tld,\
struts-bean-el.tld,\
struts-bean.tld,\
struts-html-el.tld,\
struts-html.tld,\
struts-logic-el.tld,\
struts-logic.tld,\
struts-tiles-el.tld,\
struts-tiles.tld,\
struts-nested.tld
Step 4)Edit the web.xml file
<servlet>
<servlet-name>PortletActionServlet</servlet-name>
<servlet-class>com.liferay.util.bridges.struts.LiferayPortletServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>PortletActionServlet</servlet-name>
<url-pattern>/portlet_action/*</url-pattern>
</servlet-mapping>
Step 5) Edit the Portlet.xml file
Change the <portlet-class> tag
<portlet-class>org.apache.portals.bridges.struts.StrutsPortlet</portlet-class>
<init-param>
<name>ServletContextProvider</name>
<value>com.liferay.util.bridges.struts.LiferayServletContextProviderWrapper</value>
</init-param>
<init-param>
<name>ViewPage</name>
<value>/portlet_action/struts-exercise/addname</value>
</init-param>
<init-param>
<name>EditPage</name>
<value>/portlet_action/struts-exercise/edit</value>
</init-param>
Step 6) Create StrutsSimple-config.xml
<?xml version="1.0"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

<struts-config>

<!-- Forms Beans -->

<form-beans>
<form-bean name="addNameForm" type="com.test.form.AddNameForm" />
</form-beans>

<!-- Action Mappings -->

<action-mappings>
<action path="/struts-exercise/view" forward="/html/strutsdemo/view.jsp" />
<action path="/struts-exercise/addname" type="com.test.action.AddNameAction" name="addNameForm" scope="request" validate="true" input="/html/strutsdemo/edit.jsp">
<forward name="/struts-exercise/addname/success" path="/html/strutsdemo/view.jsp" redirect="true" />
</action>
<action path="/struts-exercise/edit" forward="/html/strutsdemo/edit.jsp"/>
</action-mappings>

<!-- Custom Request Processor -->

<!-- <controller processorClass="org.apache.portals.bridges.struts.PortletTilesRequestProcessor" />
-->
<!-- Message Resources -->

<message-resources parameter="content.test.Language" />

</struts-config>
Step 7)create a portlet class called AddNameAction under src/com/test/action,
package com.test.action;

import com.test.form.AddNameForm;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletMode;
import javax.portlet.PortletPreferences;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;




public class AddNameAction extends Action {

public ActionForward execute(
ActionMapping mapping, ActionForm form, HttpServletRequest req,
HttpServletResponse res)
throws Exception {
System.out.println("AddNameAction class!!!!!!!!!!!!!");
ActionRequest aReq = (ActionRequest) req.getAttribute("javax.portlet.request");
ActionResponse aRes = (ActionResponse) req.getAttribute("javax.portlet.response");
PortletPreferences prefs = aReq.getPreferences();
String userName = ((AddNameForm)form).getUserName();
prefs.setValue("name",userName);
prefs.store();
aRes.setPortletMode( PortletMode.VIEW );
return mapping.findForward("/struts-exercise/addname/success");
}

}

Step 8)create a portlet class called AddNameForm under src/com/test/form
package com.test.form;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
public class AddNameForm extends ActionForm {
private static final long serialVersionUID = 1L;
private String userName;


public String getUserName() {
return userName;
}


public void setUserName(String userName) {
this.userName = userName;
}
public void reset(ActionMapping mapping, HttpServletRequest req) {
userName = null;
}
public ActionErrors validate(
ActionMapping mapping, HttpServletRequest req) {
ActionErrors errors = new ActionErrors();
if ((userName == null) || (userName.length() < 1)) {
errors.add(
"userName", new ActionMessage("error.lastName.required"));
}


System.out.println("AddNameForm class!!!!!!!!!!!!!");


return errors;
}


public String toString() {
return userName;
}


}
Step 9)Create a view.jsp file under docroot/html/strutsdemo folder ,put this code into the view.jsp file
view.jsp
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<%@ taglib uri="http://portals.apache.org/bridges/struts/tags-portlet-html" prefix="html" %>
<%@ taglib uri="http://portals.apache.org/bridges/struts/tags-portlet-html" prefix="html" %>
<%@page import="javax.portlet.PortletPreferences"%>
<portlet:defineObjects />

<p>This is the Struts portlet.</p>

<%
PortletPreferences prefs = renderRequest.getPreferences();
String username = (String)prefs.getValue("name", "");

%>

<p>Hello <%=username%>!</p>
<html:link page="/portlet_action/struts-exercise/edit">Back to Edit Mode</html:link>
Step 10)create edit.jsp file under docroot/html/strutsdemo folder
edit.jsp
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<%@ taglib uri="http://portals.apache.org/bridges/struts/tags-portlet-html" prefix="html" %>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

<portlet:defineObjects />

<p>The Portlet is in Edit Mode.</p>
<html:form action="/struts-exercise/addname" method="post">
<table>
<tr>
<td>Name:</td>
<td><html:text name="addNameForm" property="userName"/></td>
</tr>
</table>
<html:submit>Add Name</html:submit>

</html:form>

<html:link page="/portlet_action/struts-exercise/view">Back to View Mode</html:link>

Step 11)deploy and run your portlet




It will look like this


Enter Name and click on Add Name


It will display view.jsp