/**
 * OpenCPS is the open source Core Public Services software
 * Copyright (C) 2016-present OpenCPS community
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>
 */


package org.opencps.processmgt.util;

import java.util.ArrayList;
import java.util.List;

import javax.portlet.RenderRequest;

import com.liferay.portal.model.Role;
import com.liferay.portal.model.RoleConstants;
import com.liferay.portal.service.RoleLocalServiceUtil;

/**
 * @author khoavd
 */
public class ProcessUtils {

	/**
	 * @param renderRequest
	 * @return
	 */
	public static List<Role> getRoles(RenderRequest renderRequest) {

		List<Role> roles = new ArrayList<Role>();
		try {
			roles =
			    RoleLocalServiceUtil.getTypeRoles(RoleConstants.TYPE_REGULAR);

		}
		catch (Exception e) {
			return new ArrayList<Role>();
		}

		return roles;
	}
}

@@ -883,24 +883,362 @@
 erRequest;%0A%0A
+import org.opencps.processmgt.model.ProcessStep;%0Aimport org.opencps.processmgt.model.ServiceProcess;%0Aimport org.opencps.processmgt.service.ProcessStepLocalServiceUtil;%0Aimport org.opencps.processmgt.service.ServiceProcessLocalServiceUtil;%0A%0Aimport com.liferay.portal.kernel.util.StringPool;%0Aimport com.liferay.portal.kernel.util.Validator;%0A
 import com.l
@@ -1755,10 +1755,910 @@
 les;%0A%09%7D%0A
+%09%0A%09%0A%09/**%0A%09 * Get processName%0A%09 * %0A%09 * @param serviceProcessId%0A%09 * @return%0A%09 */%0A%09public static String getServiceProcessName(long serviceProcessId) %7B%0A%0A%09%09String processName = StringPool.BLANK;%0A%0A%09%09ServiceProcess process = null;%0A%0A%09%09try %7B%0A%09%09%09process =%0A%09%09%09    ServiceProcessLocalServiceUtil.fetchServiceProcess(serviceProcessId);%0A%09%09%7D%0A%09%09catch (Exception e) %7B%0A%09%09%09return processName;%0A%09%09%7D%0A%0A%09%09if (Validator.isNotNull(process)) %7B%0A%09%09%09processName = process.getProcessName();%0A%09%09%7D%0A%0A%09%09return processName;%0A%09%7D%0A%09%0A%0A%09/**%0A%09 * @param processStepId%0A%09 * @return%0A%09 */%0A%09public static String getProcessStepName(long processStepId) %7B%0A%0A%09%09String stepName = StringPool.BLANK;%0A%0A%09%09ProcessStep step = null;%0A%0A%09%09try %7B%0A%09%09%09step = ProcessStepLocalServiceUtil.fetchProcessStep(processStepId);%0A%09%09%7D%0A%09%09catch (Exception e) %7B%0A%09%09%09return stepName;%0A%09%09%7D%0A%0A%09%09if (Validator.isNotNull(step)) %7B%0A%09%09%09stepName = step.getStepName();%0A%09%09%7D%0A%0A%09%09return stepName;%0A%09%7D%0A%0A
 %7D%0A

Add function ProcessUtils