View Javadoc

1   /*
2    * Copyright 2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kew.api.action;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.joda.time.DateTime;
20  import org.kuali.rice.core.api.CoreConstants;
21  import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
22  import org.kuali.rice.core.api.mo.ModelBuilder;
23  import org.kuali.rice.core.api.util.jaxb.DateTimeAdapter;
24  import org.kuali.rice.kew.api.KewApiConstants;
25  import org.w3c.dom.Element;
26  
27  import javax.xml.bind.annotation.XmlAccessType;
28  import javax.xml.bind.annotation.XmlAccessorType;
29  import javax.xml.bind.annotation.XmlAnyElement;
30  import javax.xml.bind.annotation.XmlElement;
31  import javax.xml.bind.annotation.XmlElementWrapper;
32  import javax.xml.bind.annotation.XmlRootElement;
33  import javax.xml.bind.annotation.XmlType;
34  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
35  import java.io.Serializable;
36  import java.util.ArrayList;
37  import java.util.Collection;
38  import java.util.Collections;
39  import java.util.List;
40  
41  @XmlRootElement(name = ActionRequest.Constants.ROOT_ELEMENT_NAME)
42  @XmlAccessorType(XmlAccessType.NONE)
43  @XmlType(name = ActionRequest.Constants.TYPE_NAME, propOrder = {
44  		ActionRequest.Elements.ID,
45  	    ActionRequest.Elements.ACTION_REQUESTED_CODE,
46  	    ActionRequest.Elements.STATUS_CODE,
47  	    ActionRequest.Elements.CURRENT,
48  	    ActionRequest.Elements.DATE_CREATED,
49  	    ActionRequest.Elements.RESPONSIBILITY_ID,
50  	    ActionRequest.Elements.DOCUMENT_ID,
51  		ActionRequest.Elements.PRIORITY,
52          ActionRequest.Elements.ROUTE_LEVEL,
53  		ActionRequest.Elements.ANNOTATION,
54  		ActionRequest.Elements.RECIPIENT_TYPE_CODE,
55  		ActionRequest.Elements.PRINCIPAL_ID,
56  		ActionRequest.Elements.GROUP_ID,
57  		ActionRequest.Elements.REQUEST_POLICY_CODE,
58  		ActionRequest.Elements.RESPONSIBILITY_DESCRIPTION,
59  		ActionRequest.Elements.FORCE_ACTION,
60  		ActionRequest.Elements.DELEGATION_TYPE_CODE,
61  		ActionRequest.Elements.ROLE_NAME,
62  		ActionRequest.Elements.QUALIFIED_ROLE_NAME,
63  		ActionRequest.Elements.QUALIFIED_ROLE_NAME_LABEL,
64  		ActionRequest.Elements.ROUTE_NODE_INSTANCE_ID,
65  		ActionRequest.Elements.NODE_NAME,
66  		ActionRequest.Elements.REQUEST_LABEL,
67  		ActionRequest.Elements.PARENT_ACTION_REQUEST_ID,
68  		ActionRequest.Elements.ACTION_TAKEN,
69  		ActionRequest.Elements.CHILD_REQUESTS,
70  		CoreConstants.CommonElements.FUTURE_ELEMENTS
71  })
72  public final class ActionRequest extends AbstractDataTransferObject implements ActionRequestContract {
73  
74  	private static final long serialVersionUID = -7581089059447119201L;
75  
76  	@XmlElement(name = Elements.ID, required = true)
77      private final String id;
78      
79      @XmlElement(name = Elements.ACTION_REQUESTED_CODE, required = true)
80      private final String actionRequestedCode;
81      
82      @XmlElement(name = Elements.STATUS_CODE, required = true)
83      private final String statusCode;
84      
85      @XmlElement(name = Elements.CURRENT, required = true)
86      private final boolean current;
87      
88      @XmlElement(name = Elements.DATE_CREATED, required = true)
89      @XmlJavaTypeAdapter(DateTimeAdapter.class)
90      private final DateTime dateCreated;
91      
92      @XmlElement(name = Elements.RESPONSIBILITY_ID, required = true)
93      private final String responsibilityId;
94      
95      @XmlElement(name = Elements.DOCUMENT_ID, required = true)
96      private final String documentId;
97          
98      @XmlElement(name = Elements.PRIORITY, required = true)
99      private final int priority;
100 
101     @XmlElement(name = Elements.ROUTE_LEVEL, required = true)
102     private final int routeLevel;
103 
104     @XmlElement(name = Elements.ANNOTATION, required = false)
105     private final String annotation;
106     
107     @XmlElement(name = Elements.RECIPIENT_TYPE_CODE, required = true)
108     private final String recipientTypeCode;
109     
110     @XmlElement(name = Elements.PRINCIPAL_ID, required = false)
111     private final String principalId;
112     
113     @XmlElement(name = Elements.GROUP_ID, required = false)
114     private final String groupId;
115     
116     @XmlElement(name = Elements.REQUEST_POLICY_CODE, required = false)
117     private final String requestPolicyCode;
118     
119     @XmlElement(name = Elements.RESPONSIBILITY_DESCRIPTION, required = false)
120     private final String responsibilityDescription;
121     
122     @XmlElement(name = Elements.FORCE_ACTION, required = true)
123     private final boolean forceAction;
124     
125     @XmlElement(name = Elements.DELEGATION_TYPE_CODE, required = false)
126     private final String delegationTypeCode;
127     
128     @XmlElement(name = Elements.ROLE_NAME, required = false)
129     private final String roleName;
130     
131     @XmlElement(name = Elements.QUALIFIED_ROLE_NAME, required = false)
132     private final String qualifiedRoleName;
133     
134     @XmlElement(name = Elements.QUALIFIED_ROLE_NAME_LABEL, required = false)
135     private final String qualifiedRoleNameLabel;
136     
137     @XmlElement(name = Elements.ROUTE_NODE_INSTANCE_ID, required = false)
138     private final String routeNodeInstanceId;
139     
140     @XmlElement(name = Elements.NODE_NAME, required = false)
141     private final String nodeName;
142     
143     @XmlElement(name = Elements.REQUEST_LABEL, required = false)
144     private final String requestLabel;
145     
146     @XmlElement(name = Elements.PARENT_ACTION_REQUEST_ID, required = false)
147     private final String parentActionRequestId;
148     
149     @XmlElement(name = Elements.ACTION_TAKEN, required = false)
150     private final ActionTaken actionTaken;
151     
152     @XmlElementWrapper(name = Elements.CHILD_REQUESTS, required = false)
153     @XmlElement(name = Elements.CHILD_REQUEST, required = false)
154     private final List<ActionRequest> childRequests;
155     
156     @SuppressWarnings("unused")
157     @XmlAnyElement
158     private final Collection<Element> _futureElements = null;
159 
160     /**
161      * Private constructor used only by JAXB.
162      */
163     private ActionRequest() {
164         this.id = null;
165         this.actionRequestedCode = null;
166         this.statusCode = null;
167         this.current = false;
168         this.dateCreated = null;
169         this.responsibilityId = null;
170         this.documentId = null;
171         this.priority = 0;
172         this.routeLevel = 0;
173     	this.annotation = null;
174         this.recipientTypeCode = null;
175         this.principalId = null;
176         this.groupId = null;
177         this.requestPolicyCode = null;
178         this.responsibilityDescription = null;
179         this.forceAction = false;
180         this.delegationTypeCode = null;
181         this.roleName = null;
182         this.qualifiedRoleName = null;
183         this.qualifiedRoleNameLabel = null;
184         this.routeNodeInstanceId = null;
185         this.nodeName = null;
186         this.requestLabel = null;
187         this.parentActionRequestId = null;
188         this.actionTaken = null;
189         this.childRequests = null;
190     }
191 
192     private ActionRequest(Builder builder) {
193         this.id = builder.getId();
194         this.actionRequestedCode = builder.getActionRequested().getCode();
195         this.statusCode = builder.getStatus().getCode();
196         this.current = builder.isCurrent();
197         this.dateCreated = builder.getDateCreated();
198         this.responsibilityId = builder.getResponsibilityId();
199         this.documentId = builder.getDocumentId();
200         this.priority = builder.getPriority();
201         this.routeLevel = builder.getRouteLevel();
202     	this.annotation = builder.getAnnotation();
203         this.recipientTypeCode = builder.getRecipientType().getCode();
204         this.principalId = builder.getPrincipalId();
205         this.groupId = builder.getGroupId();
206         if (builder.getRequestPolicy() == null) {
207         	this.requestPolicyCode = null;
208         } else {
209         	this.requestPolicyCode = builder.getRequestPolicy().getCode();
210         }
211         this.responsibilityDescription = builder.getResponsibilityDescription();
212         this.forceAction = builder.isForceAction();
213         if (builder.getDelegationType() == null) {
214         	this.delegationTypeCode = null;
215         } else {
216         	this.delegationTypeCode = builder.getDelegationType().getCode();
217         }
218         this.roleName = builder.getRoleName();
219         this.qualifiedRoleName = builder.getQualifiedRoleName();
220         this.qualifiedRoleNameLabel = builder.getQualifiedRoleNameLabel();
221         this.routeNodeInstanceId = builder.getRouteNodeInstanceId();
222         this.nodeName = builder.getNodeName();
223         this.requestLabel = builder.getRequestLabel();
224         this.parentActionRequestId = builder.getParentActionRequestId();
225         ActionTaken.Builder actionTakenBuilder = builder.getActionTaken();
226         if (actionTakenBuilder == null) {
227         	this.actionTaken = null;
228         } else {
229         	this.actionTaken = actionTakenBuilder.build();
230         }
231         this.childRequests = new ArrayList<ActionRequest>();
232         List<ActionRequest.Builder> childRequestBuilders = builder.getChildRequests();
233         if (childRequestBuilders != null) {
234         	for (ActionRequest.Builder childRequestBuilder : childRequestBuilders) {
235         		this.childRequests.add(childRequestBuilder.build());
236         	}
237         }
238     }
239 
240     @Override
241     public String getAnnotation() {
242         return this.annotation;
243     }
244 
245     @Override
246     public int getPriority() {
247         return this.priority;
248     }
249 
250     @Override
251     public int getRouteLevel() {
252         return this.routeLevel;
253     }
254 
255     @Override
256     public String getId() {
257         return this.id;
258     }
259 
260     @Override
261     public ActionRequestType getActionRequested() {
262         return ActionRequestType.fromCode(this.actionRequestedCode);
263     }
264 
265     @Override
266     public ActionRequestStatus getStatus() {
267         return ActionRequestStatus.fromCode(this.statusCode);
268     }
269 
270     @Override
271     public boolean isCurrent() {
272         return this.current;
273     }
274 
275     @Override
276     public DateTime getDateCreated() {
277         return this.dateCreated;
278     }
279 
280     @Override
281     public String getResponsibilityId() {
282         return this.responsibilityId;
283     }
284 
285     @Override
286     public String getDocumentId() {
287         return this.documentId;
288     }
289 
290     @Override
291     public RecipientType getRecipientType() {
292         return RecipientType.fromCode(this.recipientTypeCode);
293     }
294 
295     @Override
296     public String getPrincipalId() {
297         return this.principalId;
298     }
299 
300     @Override
301     public String getGroupId() {
302         return this.groupId;
303     }
304 
305     @Override
306     public ActionRequestPolicy getRequestPolicy() {
307     	if (this.requestPolicyCode == null) {
308     		return null;
309     	}
310         return ActionRequestPolicy.fromCode(this.requestPolicyCode);
311     }
312 
313     @Override
314     public String getResponsibilityDescription() {
315         return this.responsibilityDescription;
316     }
317 
318     @Override
319     public boolean isForceAction() {
320         return this.forceAction;
321     }
322 
323     @Override
324     public DelegationType getDelegationType() {
325     	if (this.delegationTypeCode == null) {
326     		return null;
327     	}
328         return DelegationType.fromCode(this.delegationTypeCode);
329     }
330 
331     @Override
332     public String getRoleName() {
333         return this.roleName;
334     }
335 
336     @Override
337     public String getQualifiedRoleName() {
338         return this.qualifiedRoleName;
339     }
340 
341     @Override
342     public String getQualifiedRoleNameLabel() {
343         return this.qualifiedRoleNameLabel;
344     }
345 
346     @Override
347     public String getRouteNodeInstanceId() {
348         return this.routeNodeInstanceId;
349     }
350     
351     @Override
352     public String getNodeName() {
353         return this.nodeName;
354     }
355 
356     @Override
357     public String getRequestLabel() {
358         return this.requestLabel;
359     }
360 
361     @Override
362     public String getParentActionRequestId() {
363         return this.parentActionRequestId;
364     }
365 
366     @Override
367     public ActionTaken getActionTaken() {
368         return this.actionTaken;
369     }
370     
371     @Override
372     public List<ActionRequest> getChildRequests() {
373     	if (this.childRequests == null) {
374     		return Collections.emptyList();
375     	} else {
376     		return Collections.unmodifiableList(this.childRequests);
377     	}
378     }
379 
380     public boolean isAdHocRequest() {
381     	return KewApiConstants.ADHOC_REQUEST_RESPONSIBILITY_ID.equals(getResponsibilityId());
382     }
383 
384     public boolean isGeneratedRequest() {
385     	return KewApiConstants.MACHINE_GENERATED_RESPONSIBILITY_ID.equals(getResponsibilityId());
386     }
387 
388     public boolean isExceptionRequest() {
389     	return KewApiConstants.EXCEPTION_REQUEST_RESPONSIBILITY_ID.equals(getResponsibilityId());
390     }
391 
392     public boolean isRouteModuleRequest() {
393     	return getResponsibilityId() != null && Long.parseLong(getResponsibilityId()) > 0;
394     }
395     
396     public boolean isNotificationRequest() {
397         return isAcknowledgeRequest() || isFyiRequest();
398     }
399 
400     public boolean isApprovalRequest() {
401         return ActionRequestType.APPROVE == getActionRequested() || ActionRequestType.COMPLETE == getActionRequested();
402     }
403 
404     public boolean isAcknowledgeRequest() {
405         return ActionRequestType.ACKNOWLEDGE == getActionRequested();
406     }
407 
408     public boolean isFyiRequest() {
409         return ActionRequestType.FYI == getActionRequested();
410     }
411 
412     public boolean isPending() {
413         return isInitialized() || isActivated();
414     }
415 
416     public boolean isCompleteRequest() {
417         return ActionRequestType.COMPLETE == getActionRequested();
418     }
419 
420     public boolean isInitialized() {
421         return ActionRequestStatus.INITIALIZED == getStatus();
422     }
423 
424     public boolean isActivated() {
425         return ActionRequestStatus.ACTIVATED == getStatus();
426     }
427 
428     public boolean isDone() {
429         return ActionRequestStatus.DONE == getStatus();
430     }
431 
432     public boolean isUserRequest() {
433         return RecipientType.PRINCIPAL == getRecipientType();
434     }
435 
436     public boolean isGroupRequest() {
437     	return RecipientType.GROUP == getRecipientType();
438     }
439 
440     public boolean isRoleRequest() {
441     	return RecipientType.ROLE == getRecipientType();
442     }
443     
444     public List<ActionRequest> flatten() {
445     	List<ActionRequest> flattenedRequests = new ArrayList<ActionRequest>();
446     	flattenedRequests.add(this);
447     	for (ActionRequest childRequest : getChildRequests()) {
448     		flattenedRequests.addAll(childRequest.flatten());
449     	}
450     	return Collections.unmodifiableList(flattenedRequests);
451     }
452 
453     /**
454      * A builder which can be used to construct {@link ActionRequest} instances.  Enforces the constraints of the {@link ActionRequestContract}.
455      */
456     public final static class Builder implements Serializable, ModelBuilder, ActionRequestContract {
457 
458 		private static final long serialVersionUID = -1354211147778354091L;
459 
460 		private String id;
461         private ActionRequestType actionRequested;
462         private ActionRequestStatus status;
463         private boolean current;
464         private DateTime dateCreated;
465         private String responsibilityId;
466         private String documentId;
467         private int priority;
468         private int routeLevel;
469         private String annotation;
470         private RecipientType recipientType;
471         private String principalId;
472         private String groupId;
473         private ActionRequestPolicy requestPolicy;
474         private String responsibilityDescription;
475         private boolean forceAction;
476         private DelegationType delegationType;
477         private String roleName;
478         private String qualifiedRoleName;
479         private String qualifiedRoleNameLabel;
480         private String routeNodeInstanceId;
481         private String nodeName;
482         private String requestLabel;
483         private String parentActionRequestId;
484         private ActionTaken.Builder actionTaken;
485         private List<ActionRequest.Builder> childRequests;
486 
487         private Builder(String id, ActionRequestType actionRequested, ActionRequestStatus status, String responsibilityId, String documentId, RecipientType recipientType) {
488             setId(id);
489             setActionRequested(actionRequested);
490             setStatus(status);
491             setResponsibilityId(responsibilityId);
492             setDocumentId(documentId);
493             setRecipientType(recipientType);
494             setCurrent(true);
495             setDateCreated(new DateTime());
496         }
497 
498         public static Builder create(String id, ActionRequestType actionRequested, ActionRequestStatus status, String responsibilityId, String documentId, RecipientType recipientType) {
499             return new Builder(id, actionRequested, status, responsibilityId, documentId, recipientType);
500         }
501 
502         public static Builder create(ActionRequestContract contract) {
503             if (contract == null) {
504                 throw new IllegalArgumentException("contract was null");
505             }
506             // TODO if create() is modified to accept required parameters, this will need to be modified
507             Builder builder = create(contract.getId(), contract.getActionRequested(), contract.getStatus(), contract.getResponsibilityId(), contract.getDocumentId(), contract.getRecipientType());
508             builder.setCurrent(contract.isCurrent());
509             builder.setDateCreated(contract.getDateCreated());
510             builder.setPriority(contract.getPriority());
511             builder.setRouteLevel(contract.getRouteLevel());
512             builder.setAnnotation(contract.getAnnotation());
513             builder.setPrincipalId(contract.getPrincipalId());
514             builder.setGroupId(contract.getGroupId());
515             builder.setRequestPolicy(contract.getRequestPolicy());
516             builder.setResponsibilityDescription(contract.getResponsibilityDescription());
517             builder.setForceAction(contract.isForceAction());
518             builder.setDelegationType(contract.getDelegationType());
519             builder.setRoleName(contract.getRoleName());
520             builder.setQualifiedRoleName(contract.getQualifiedRoleName());
521             builder.setQualifiedRoleNameLabel(contract.getQualifiedRoleNameLabel());
522             builder.setNodeName(contract.getNodeName());
523             builder.setRequestLabel(contract.getRequestLabel());
524             builder.setParentActionRequestId(contract.getParentActionRequestId());
525             if (contract.getActionTaken() != null) {
526             	builder.setActionTaken(ActionTaken.Builder.create(contract.getActionTaken()));
527             }
528             List<ActionRequest.Builder> actionRequestBuilders = new ArrayList<ActionRequest.Builder>();
529             for (ActionRequestContract actionRequest : contract.getChildRequests()) {
530             	actionRequestBuilders.add(ActionRequest.Builder.create(actionRequest));
531             }
532             builder.setChildRequests(actionRequestBuilders);
533             return builder;
534         }
535 
536         public ActionRequest build() {
537             return new ActionRequest(this);
538         }
539 
540         @Override
541         public String getId() {
542             return this.id;
543         }
544 
545         @Override
546         public ActionRequestType getActionRequested() {
547             return this.actionRequested;
548         }
549 
550         @Override
551         public ActionRequestStatus getStatus() {
552             return this.status;
553         }
554 
555         @Override
556         public boolean isCurrent() {
557             return this.current;
558         }
559 
560         @Override
561         public DateTime getDateCreated() {
562             return this.dateCreated;
563         }
564 
565         @Override
566         public String getResponsibilityId() {
567             return this.responsibilityId;
568         }
569 
570         @Override
571         public String getDocumentId() {
572             return this.documentId;
573         }
574 
575         @Override
576         public int getPriority() {
577             return this.priority;
578         }
579 
580         @Override
581         public int getRouteLevel() {
582             return this.routeLevel;
583         }
584 
585         @Override
586         public String getAnnotation() {
587             return this.annotation;
588         }
589         
590         @Override
591         public RecipientType getRecipientType() {
592             return this.recipientType;
593         }
594 
595         @Override
596         public String getPrincipalId() {
597             return this.principalId;
598         }
599 
600         @Override
601         public String getGroupId() {
602             return this.groupId;
603         }
604 
605         @Override
606         public ActionRequestPolicy getRequestPolicy() {
607             return this.requestPolicy;
608         }
609 
610         @Override
611         public String getResponsibilityDescription() {
612             return this.responsibilityDescription;
613         }
614 
615         @Override
616         public boolean isForceAction() {
617             return this.forceAction;
618         }
619 
620         @Override
621         public DelegationType getDelegationType() {
622             return this.delegationType;
623         }
624 
625         @Override
626         public String getRoleName() {
627             return this.roleName;
628         }
629 
630         @Override
631         public String getQualifiedRoleName() {
632             return this.qualifiedRoleName;
633         }
634 
635         @Override
636         public String getQualifiedRoleNameLabel() {
637             return this.qualifiedRoleNameLabel;
638         }
639 
640         @Override
641         public String getRouteNodeInstanceId() {
642         	return this.routeNodeInstanceId;
643         }
644         
645         @Override
646         public String getNodeName() {
647             return this.nodeName;
648         }
649 
650         @Override
651         public String getRequestLabel() {
652             return this.requestLabel;
653         }
654 
655         @Override
656         public String getParentActionRequestId() {
657             return this.parentActionRequestId;
658         }
659 
660         @Override
661         public ActionTaken.Builder getActionTaken() {
662             return this.actionTaken;
663         }
664 
665         @Override
666         public List<ActionRequest.Builder> getChildRequests() {
667             return this.childRequests;
668         }
669 
670         public void setId(String id) {
671             if (StringUtils.isWhitespace(id)) {
672             	throw new IllegalArgumentException("id was null or blank");
673             }
674             this.id = id;
675         }
676 
677         public void setActionRequested(ActionRequestType actionRequested) {
678             if (actionRequested == null) {
679             	throw new IllegalArgumentException("actionRequested was null");
680             }
681             this.actionRequested = actionRequested;
682         }
683 
684         public void setStatus(ActionRequestStatus status) {
685             if (status == null) {
686             	throw new IllegalArgumentException("status was null");
687             }
688             this.status = status;
689         }
690 
691         public void setCurrent(boolean current) {
692             this.current = current;
693         }
694 
695         public void setDateCreated(DateTime dateCreated) {
696         	if (dateCreated == null) {
697         		throw new IllegalArgumentException("dateCreated was null");
698         	}
699             this.dateCreated = dateCreated;
700         }
701 
702         public void setResponsibilityId(String responsibilityId) {
703         	if (StringUtils.isBlank(responsibilityId)) {
704         		throw new IllegalArgumentException("responsibilityId was null or blank");
705         	}
706             this.responsibilityId = responsibilityId;
707         }
708 
709         public void setDocumentId(String documentId) {
710             if (StringUtils.isBlank(documentId)) {
711             	throw new IllegalArgumentException("documentId was null or blank");
712             }
713             this.documentId = documentId;
714         }
715 
716         public void setPriority(int priority) {
717             this.priority = priority;
718         }
719 
720         public void setRouteLevel(int routeLevel) {
721             this.routeLevel = routeLevel;
722         }
723 
724         public void setAnnotation(String annotation) {
725             this.annotation = annotation;
726         }
727 
728         public void setRecipientType(RecipientType recipientType) {
729         	if (recipientType == null) {
730         		throw new IllegalArgumentException("recipientType was null");
731         	}
732             this.recipientType = recipientType;
733         }
734 
735         public void setPrincipalId(String principalId) {
736             this.principalId = principalId;
737         }
738 
739         public void setGroupId(String groupId) {
740             this.groupId = groupId;
741         }
742 
743         public void setRequestPolicy(ActionRequestPolicy requestPolicy) {
744             this.requestPolicy = requestPolicy;
745         }
746 
747         public void setResponsibilityDescription(String responsibilityDescription) {
748             this.responsibilityDescription = responsibilityDescription;
749         }
750 
751         public void setForceAction(boolean forceAction) {
752             this.forceAction = forceAction;
753         }
754 
755         public void setDelegationType(DelegationType delegationType) {
756             this.delegationType = delegationType;
757         }
758 
759         public void setRoleName(String roleName) {
760             this.roleName = roleName;
761         }
762 
763         public void setQualifiedRoleName(String qualifiedRoleName) {
764             this.qualifiedRoleName = qualifiedRoleName;
765         }
766 
767         public void setQualifiedRoleNameLabel(String qualifiedRoleNameLabel) {
768             this.qualifiedRoleNameLabel = qualifiedRoleNameLabel;
769         }
770         
771         public void setRouteNodeInstanceId(String routeNodeInstanceId) {
772         	this.routeNodeInstanceId = routeNodeInstanceId;
773         }
774 
775         public void setNodeName(String nodeName) {
776             this.nodeName = nodeName;
777         }
778 
779         public void setRequestLabel(String requestLabel) {
780             this.requestLabel = requestLabel;
781         }
782 
783         public void setParentActionRequestId(String parentActionRequestId) {
784             this.parentActionRequestId = parentActionRequestId;
785         }
786 
787         public void setActionTaken(ActionTaken.Builder actionTaken) {
788             this.actionTaken = actionTaken;
789         }
790 
791         public void setChildRequests(List<ActionRequest.Builder> childRequests) {
792             this.childRequests = childRequests;
793         }
794 
795     }
796 
797 
798     /**
799      * Defines some internal constants used on this class.
800      * 
801      */
802     static class Constants {
803         final static String ROOT_ELEMENT_NAME = "actionRequest";
804         final static String TYPE_NAME = "ActionRequestType";
805     }
806 
807 
808     /**
809      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
810      * 
811      */
812     static class Elements {
813         final static String ANNOTATION = "annotation";
814         final static String PRIORITY = "priority";
815         final static String ID = "id";
816         final static String ACTION_REQUESTED_CODE = "actionRequestedCode";
817         final static String STATUS_CODE = "statusCode";
818         final static String CURRENT = "current";
819         final static String ROUTE_LEVEL = "routeLevel";
820         final static String DATE_CREATED = "dateCreated";
821         final static String RESPONSIBILITY_ID = "responsibilityId";
822         final static String DOCUMENT_ID = "documentId";
823         final static String RECIPIENT_TYPE_CODE = "recipientTypeCode";
824         final static String PRINCIPAL_ID = "principalId";
825         final static String GROUP_ID = "groupId";
826         final static String REQUEST_POLICY_CODE = "requestPolicyCode";
827         final static String RESPONSIBILITY_DESCRIPTION = "responsibilityDescription";
828         final static String FORCE_ACTION = "forceAction";
829         final static String DELEGATION_TYPE_CODE = "delegationTypeCode";
830         final static String ROLE_NAME = "roleName";
831         final static String QUALIFIED_ROLE_NAME = "qualifiedRoleName";
832         final static String QUALIFIED_ROLE_NAME_LABEL = "qualifiedRoleNameLabel";
833         final static String ROUTE_NODE_INSTANCE_ID = "routeNodeInstanceId";
834         final static String NODE_NAME = "nodeName";
835         final static String REQUEST_LABEL = "requestLabel";
836         final static String PARENT_ACTION_REQUEST_ID = "parentActionRequestId";
837         final static String ACTION_TAKEN = "actionTaken";
838         final static String CHILD_REQUESTS = "childRequests";
839         final static String CHILD_REQUEST = "childRequest";
840     }
841 
842 }
843