KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > assignment > XPDLStraightParticipantMappingAssignmentManager


1 package org.enhydra.shark.assignment;
2
3
4 import java.util.ArrayList JavaDoc;
5 import java.util.Iterator JavaDoc;
6 import java.util.List JavaDoc;
7
8 import org.enhydra.shark.api.RootException;
9 import org.enhydra.shark.api.SharkTransaction;
10 import org.enhydra.shark.api.internal.assignment.AssignmentManager;
11 import org.enhydra.shark.api.internal.assignment.PerformerData;
12 import org.enhydra.shark.api.internal.working.CallbackUtilities;
13
14 /**
15  *
16  * @author Sasa Bojanic
17  *
18  */

19 public class XPDLStraightParticipantMappingAssignmentManager implements AssignmentManager {
20
21    private CallbackUtilities cus;
22    public void configure (CallbackUtilities cus) throws RootException {
23       this.cus=cus;
24    }
25
26
27    public List JavaDoc getAssignments (SharkTransaction t,
28                                String JavaDoc engineName,
29                                String JavaDoc procId,
30                                String JavaDoc actId,
31                                List JavaDoc userIds,
32                                List JavaDoc responsibleIds,
33                                String JavaDoc processRequesterId,
34                                PerformerData xpdlParticipant,
35                                List JavaDoc xpdlResponsibleParticipants) throws RootException {
36
37       List JavaDoc toRet=new ArrayList JavaDoc();
38       if (xpdlParticipant!=null &&
39             xpdlParticipant.participantIdOrExpression!=null &&
40             !xpdlParticipant.participantIdOrExpression.equals("")) {
41          toRet.add(xpdlParticipant.participantIdOrExpression);
42          return toRet;
43       }
44       if (xpdlResponsibleParticipants!=null && xpdlResponsibleParticipants.size()>0) {
45          Iterator JavaDoc it=xpdlResponsibleParticipants.iterator();
46          while (it.hasNext()) {
47             PerformerData pd=(PerformerData)it.next();
48             if (pd.participantIdOrExpression!=null) {
49                toRet.add(pd.participantIdOrExpression);
50             }
51          }
52          if (toRet.size()>0) {
53             return toRet;
54          }
55       }
56       //if (extAttribs!=null)
57
toRet.add(processRequesterId);
58       return toRet;
59    }
60
61 }
62
Popular Tags