01: /*
02: * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
03: * Copyright (C) 2006-2007 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
04: *
05: * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
06: * General Public License as published by the Free Software Foundation; either version 2 of the License,
07: * or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
10: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public License along with this program; if not,
14: * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15: */
16:
17: package wilos.business.webservices.transfertobject;
18:
19: import java.io.Serializable;
20: import java.util.HashSet;
21: import java.util.Set;
22:
23: import wilos.model.misc.concreteactivity.ConcreteActivity;
24: import wilos.model.misc.concreterole.ConcreteRoleDescriptor;
25: import wilos.model.misc.concretetask.ConcreteTaskDescriptor;
26:
27: public class ConcreteRoleDescriptorTO extends ConcreteRoleDescriptor
28: implements Serializable {
29:
30: /**
31: *
32: */
33: private static final long serialVersionUID = -6193498903419221055L;
34:
35: /** Creates a new instance of ParticipantTO */
36: public ConcreteRoleDescriptorTO() {
37:
38: }
39:
40: public ConcreteRoleDescriptorTO(
41: ConcreteRoleDescriptor myConcreteRoleDescriptor) {
42: this .setId(myConcreteRoleDescriptor.getId());
43: this
44: .setConcreteName(myConcreteRoleDescriptor
45: .getConcreteName());
46: this .setInstanciationOrder(myConcreteRoleDescriptor
47: .getInstanciationOrder());
48:
49: if (myConcreteRoleDescriptor.getRoleDescriptor() != null)
50: this .setRoleDescriptor(new RoleDescriptorTO(
51: myConcreteRoleDescriptor.getRoleDescriptor()));
52:
53: Set<ConcreteActivity> concreteActivitys = ConcreteActivityTO
54: .getConcreteActivities(myConcreteRoleDescriptor);
55: this .setSuperConcreteActivities(concreteActivitys);
56:
57: Set<ConcreteTaskDescriptor> concreteTaskDescriptors = new HashSet<ConcreteTaskDescriptor>();
58: for (ConcreteTaskDescriptor ctd : myConcreteRoleDescriptor
59: .getPrimaryConcreteTaskDescriptors()) {
60: concreteTaskDescriptors.add(new ConcreteTaskDescriptorTO(
61: ctd));
62: }
63: this.setPrimaryConcreteTaskDescriptors(concreteTaskDescriptors);
64:
65: }
66: }
|