001: /*
002: * JBoss, Home of Professional Open Source
003: * Copyright 2005, JBoss Inc., and individual contributors as indicated
004: * by the @authors tag. See the copyright.txt in the distribution for a
005: * full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jbpm.taskmgmt.exe;
023:
024: import java.io.*;
025: import java.util.Set;
026:
027: import org.jbpm.taskmgmt.def.*;
028: import org.jbpm.util.EqualsUtil;
029:
030: /**
031: * is a process role for a one process instance.
032: */
033: public class SwimlaneInstance implements Serializable, Assignable {
034:
035: private static final long serialVersionUID = 1L;
036:
037: long id = 0;
038: int version = 0;
039: protected String name = null;
040: protected String actorId = null;
041: protected Set pooledActors = null;
042: protected Swimlane swimlane = null;
043: protected TaskMgmtInstance taskMgmtInstance = null;
044:
045: public SwimlaneInstance() {
046: }
047:
048: public SwimlaneInstance(Swimlane swimlane) {
049: this .name = swimlane.getName();
050: this .swimlane = swimlane;
051: }
052:
053: public void setPooledActors(String[] actorIds) {
054: this .pooledActors = PooledActor
055: .createPool(actorIds, this , null);
056: }
057:
058: // equals ///////////////////////////////////////////////////////////////////
059: // hack to support comparing hibernate proxies against the real objects
060: // since this always falls back to ==, we don't need to overwrite the hashcode
061: public boolean equals(Object o) {
062: return EqualsUtil.equals(this , o);
063: }
064:
065: // getters and setters //////////////////////////////////////////////////////
066:
067: public long getId() {
068: return id;
069: }
070:
071: public String getName() {
072: return name;
073: }
074:
075: public Swimlane getSwimlane() {
076: return swimlane;
077: }
078:
079: public String getActorId() {
080: return actorId;
081: }
082:
083: public void setActorId(String actorId) {
084: this .actorId = actorId;
085: }
086:
087: public TaskMgmtInstance getTaskMgmtInstance() {
088: return taskMgmtInstance;
089: }
090:
091: public void setTaskMgmtInstance(TaskMgmtInstance taskMgmtInstance) {
092: this .taskMgmtInstance = taskMgmtInstance;
093: }
094:
095: public Set getPooledActors() {
096: return pooledActors;
097: }
098:
099: public void setPooledActors(Set pooledActors) {
100: this.pooledActors = pooledActors;
101: }
102: }
|