Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.kuali.rice.kew.engine.simulation;
An object represnting an action to take in the simulation engine

Author(s):
Kuali Rice Team (rice.collab@kuali.org)
public class SimulationActionToTake implements Serializable {
	private static final long serialVersionUID = 5212455086079117671L;
    private Person user;
    private String nodeName;
    public SimulationActionToTake() {
    }
	}
	public void setActionToPerform(String actionToPerform) {
		this. = actionToPerform;
	}
	public String getNodeName() {
		return ;
	}
	public void setNodeName(String nodeName) {
		this. = nodeName;
	}
	public Person getUser() {
		return ;
	}
	public void setUser(Person user) {
		this. = user;
	}
    public static SimulationActionToTake from(RoutingReportActionToTake actionToTake) {
        if (actionToTake == null) {
            return null;
        }
        SimulationActionToTake simActionToTake = new SimulationActionToTake();
        simActionToTake.setNodeName(actionToTake.getNodeName());
        if (StringUtils.isBlank(actionToTake.getActionToPerform())) {
            throw new IllegalArgumentException("ReportActionToTakeVO must contain an action taken code and does not");
        }
        simActionToTake.setActionToPerform(actionToTake.getActionToPerform());
        if (actionToTake.getPrincipalId() == null) {
            throw new IllegalArgumentException("ReportActionToTakeVO must contain a principalId and does not");
        }
        Principal kPrinc = KEWServiceLocator.getIdentityHelperService().getPrincipal(actionToTake.getPrincipalId());
        Person user = KimApiServiceLocator.getPersonService().getPerson(kPrinc.getPrincipalId());
        if (user == null) {
            throw new IllegalStateException("Could not locate Person for the given id: " + actionToTake.getPrincipalId());
        }
        simActionToTake.setUser(user);
        return simActionToTake;
    }
New to GrepCode? Check out our FAQ X