001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.bpmscript.jbi.tasklist;
018:
019: import java.io.Serializable;
020: import java.util.ArrayList;
021: import java.util.List;
022:
023: public class TaskRequest implements ITaskRequest, Serializable {
024:
025: private static final long serialVersionUID = -5495807513463018244L;
026:
027: private Object message;
028: private String role;
029: private String user;
030: private String processInstanceId;
031:
032: public TaskRequest() {
033:
034: }
035:
036: public TaskRequest(Object message) {
037: this .message = message;
038: }
039:
040: public TaskRequest(String processInstanceId, Object message) {
041: this .message = message;
042: this .processInstanceId = processInstanceId;
043: }
044:
045: private List<IAllowableResponse> allowableResponses = new ArrayList<IAllowableResponse>();
046:
047: public AllowableResponse response(String path, Object message,
048: IType definition) {
049: AllowableResponse allowableResponse = new AllowableResponse(
050: path, message, definition);
051: allowableResponses.add(allowableResponse);
052: return allowableResponse;
053: }
054:
055: public AllowableResponse response(String path) {
056: AllowableResponse allowableResponse = new AllowableResponse(
057: path, null, NullType.NULL_TYPE);
058: allowableResponses.add(allowableResponse);
059: return allowableResponse;
060: }
061:
062: public AllowableResponse response(String path, Object message) {
063: AllowableResponse allowableResponse = new AllowableResponse(
064: path, message, NullType.NULL_TYPE);
065: allowableResponses.add(allowableResponse);
066: return allowableResponse;
067: }
068:
069: public List<IAllowableResponse> getAllowableResponses() {
070: return allowableResponses;
071: }
072:
073: public void setAllowableResponses(
074: List<IAllowableResponse> allowableResponses) {
075: this .allowableResponses = allowableResponses;
076: }
077:
078: public Object getMessage() {
079: return message;
080: }
081:
082: public void setMessage(Object message) {
083: this .message = message;
084: }
085:
086: public String getRole() {
087: return role;
088: }
089:
090: public void setRole(String role) {
091: this .role = role;
092: }
093:
094: public String getUser() {
095: return user;
096: }
097:
098: public void setUser(String user) {
099: this .user = user;
100: }
101:
102: public String getProcessInstanceId() {
103: return processInstanceId;
104: }
105:
106: public void setProcessInstanceId(String processInstanceId) {
107: this.processInstanceId = processInstanceId;
108: }
109:
110: }
|