View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.jbpm;
8   
9   import java.util.Collection;
10  import java.util.Map;
11  import java.util.Set;
12  
13  import org.jbpm.api.Execution;
14  import org.jbpm.api.ProcessInstance;
15  
16  /**
17   * Placeholder used to get status for a process in a uniform way, even if it has ended.
18   */
19  public class EndedProcess implements ProcessInstance
20  {
21      private String id;
22  
23      public EndedProcess(String id)
24      {
25          this.id = id;
26      }
27      
28      public String getId()
29      {
30          return id;
31      }
32  
33      public boolean isEnded()
34      {
35          return true;
36      }
37  
38      public Set<String> findActiveActivityNames()
39      {
40          return null;
41      }
42  
43      public Execution findActiveExecutionIn(String activityName)
44      {
45          return null;
46      }
47  
48      public Execution getExecution(String name)
49      {
50          return null;
51      }
52  
53      public Collection<? extends Execution> getExecutions()
54      {
55          return null;
56      }
57  
58      public Map<String, Execution> getExecutionsMap()
59      {
60          return null;
61      }
62  
63      public boolean getIsProcessInstance()
64      {
65          return true;
66      }
67  
68      public String getKey()
69      {
70          return null;
71      }
72  
73      public String getName()
74      {
75          return null;
76      }
77  
78      public Execution getParent()
79      {
80          return null;
81      }
82  
83      public int getPriority()
84      {
85          return 0;
86      }
87  
88      public String getProcessDefinitionId()
89      {
90          return null;
91      }
92  
93      public Execution getProcessInstance()
94      {
95          return null;
96      }
97  
98      public Execution getSubProcessInstance()
99      {
100         return null;
101     }
102     
103     public String getState()
104     {
105         return ProcessInstance.STATE_ENDED;
106     }
107 
108     public boolean hasExecution(String executionName)
109     {
110         return false;
111     }
112 
113     public boolean isActive(String activityName)
114     {
115         return false;
116     }
117 
118     public boolean isSuspended()
119     {
120         return false;
121     }
122 }
123 
124