summaryrefslogtreecommitdiffstats
blob: 42b90abdcb8d9a09d699d916550246f79c29fe28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
/*******************************************************************************
 * Copyright (c) 2012 SunGard CSA LLC and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     SunGard CSA LLC - initial API and implementation
 *******************************************************************************/
package org.eclipse.stardust.model.xpdl.builder;

import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.stardust.model.xpdl.builder.activity.AbstractActivityBuilder;
import org.eclipse.stardust.model.xpdl.builder.activity.BpmApplicationActivityBuilder;
import org.eclipse.stardust.model.xpdl.builder.activity.BpmInteractiveApplicationActivityBuilder;
import org.eclipse.stardust.model.xpdl.builder.activity.BpmManualActivityBuilder;
import org.eclipse.stardust.model.xpdl.builder.activity.BpmRouteActivityBuilder;
import org.eclipse.stardust.model.xpdl.builder.activity.BpmSubProcessActivityBuilder;
import org.eclipse.stardust.model.xpdl.builder.datamapping.BpmDataMappingBuilder;
import org.eclipse.stardust.model.xpdl.builder.datamapping.BpmInDataMappingBuilder;
import org.eclipse.stardust.model.xpdl.builder.datamapping.BpmOutDataMappingBuilder;
import org.eclipse.stardust.model.xpdl.builder.diagram.BpmDiagramBuilder;
import org.eclipse.stardust.model.xpdl.builder.eventaction.BpmExcludeUserEventActionBuilder;
import org.eclipse.stardust.model.xpdl.builder.eventhandler.BpmActivityAssignmentEventHandlerBuilder;
import org.eclipse.stardust.model.xpdl.builder.model.BpmPackageBuilder;
import org.eclipse.stardust.model.xpdl.builder.participant.BpmConditionalPerformerBuilder;
import org.eclipse.stardust.model.xpdl.builder.participant.BpmOrganizationBuilder;
import org.eclipse.stardust.model.xpdl.builder.participant.BpmRoleBuilder;
import org.eclipse.stardust.model.xpdl.builder.process.BpmDataPathBuilder;
import org.eclipse.stardust.model.xpdl.builder.process.BpmManualTriggerBuilder;
import org.eclipse.stardust.model.xpdl.builder.process.BpmProcessDefinitionBuilder;
import org.eclipse.stardust.model.xpdl.builder.transition.AbstractTransitionBuilder;
import org.eclipse.stardust.model.xpdl.builder.transition.BpmActivitySequenceBuilder;
import org.eclipse.stardust.model.xpdl.builder.transition.BpmConditionalTransitionBuilder;
import org.eclipse.stardust.model.xpdl.builder.transition.BpmOtherwiseTransitionBuilder;
import org.eclipse.stardust.model.xpdl.builder.utils.XpdlModelUtils;
import org.eclipse.stardust.model.xpdl.builder.variable.BpmDocumentVariableBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.BpmPrimitiveVariableBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.BpmStructVariableBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.CamelApplicationBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.ExternalWebApplicationApplicationBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.MessageTransformationApplicationBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.PrimitiveAccessPointBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.StructAccessPointBuilder;
import org.eclipse.stardust.model.xpdl.builder.variable.WebserviceApplicationBuilder;
import org.eclipse.stardust.model.xpdl.carnot.ActivityType;
import org.eclipse.stardust.model.xpdl.carnot.EventHandlerType;
import org.eclipse.stardust.model.xpdl.carnot.IAccessPointOwner;
import org.eclipse.stardust.model.xpdl.carnot.IModelElement;
import org.eclipse.stardust.model.xpdl.carnot.ModelType;
import org.eclipse.stardust.model.xpdl.carnot.ProcessDefinitionType;



public abstract class BpmModelBuilder
{
   public static void assignMissingElementOids(ModelType model)
   {
      long maxElementOid = XpdlModelUtils.getMaxUsedOid(model);

      if ( !model.isSetOid())
      {
         model.setOid(++maxElementOid);
      }

      for (TreeIterator<EObject> modelContents = model.eAllContents(); modelContents.hasNext(); )
      {
         EObject element = modelContents.next();
         if ((element instanceof IModelElement)
               && !((IModelElement) element).isSetElementOid())
         {
            ((IModelElement) element).setElementOid(++maxElementOid);
         }
      }
   }

   public static BpmPackageBuilder newBpmModel()
   {
      return BpmPackageBuilder.newModel();
   }


   public static PrimitiveAccessPointBuilder newPrimitiveAccessPoint(IAccessPointOwner anOwner)
   {
      return PrimitiveAccessPointBuilder.newAccessPoint(anOwner);
   }

   public static StructAccessPointBuilder newStructuredAccessPoint(IAccessPointOwner anOwner)
   {
      return StructAccessPointBuilder.newAccessPoint(anOwner);
   }

   public static CamelApplicationBuilder newCamelApplication(ModelType model)
   {
      return CamelApplicationBuilder.newCamelApplication(model);
   }

   public static WebserviceApplicationBuilder newWebserviceApplication(ModelType model)
   {
      return WebserviceApplicationBuilder.newWebserviceApplication(model);
   }

   public static MessageTransformationApplicationBuilder newMessageTransformationApplication(ModelType model)
   {
      return MessageTransformationApplicationBuilder.newMessageTransformationApplication(model);
   }

   public static ExternalWebApplicationApplicationBuilder newExternalWebApplication(ModelType model)
   {
      return ExternalWebApplicationApplicationBuilder.newExternalWebApplication(model);
   }

   public static BpmPrimitiveVariableBuilder<Object> newPrimitiveVariable()
   {
      return BpmPrimitiveVariableBuilder.newPrimitiveVariable();
   }

   public static BpmPrimitiveVariableBuilder<Object> newPrimitiveVariable(ModelType model)
   {
      return BpmPrimitiveVariableBuilder.newPrimitiveVariable(model);
   }

   public static BpmStructVariableBuilder newStructVariable(ModelType model)
   {
      return BpmStructVariableBuilder.newStructVariable(model);
   }

   public static BpmDocumentVariableBuilder newDocumentVariable(ModelType model)
   {
      return BpmDocumentVariableBuilder.newDocumentVariable(model);
   }

   public static BpmRoleBuilder newRole(ModelType model)
   {
      return BpmRoleBuilder.newRole(model);
   }

   public static BpmOrganizationBuilder newOrganization(ModelType model)
   {
      return BpmOrganizationBuilder.newOrganization(model);
   }

   public static BpmConditionalPerformerBuilder newConditionalPerformer(ModelType model)
   {
      return BpmConditionalPerformerBuilder.newConditionalPerformer(model);
   }

   public static BpmProcessDefinitionBuilder newProcessDefinition()
   {
      return BpmProcessDefinitionBuilder.newProcessDefinition();
   }

   public static BpmProcessDefinitionBuilder newProcessDefinition(ModelType model)
   {
      return BpmProcessDefinitionBuilder.newProcessDefinition(model);
   }

   public static BpmManualTriggerBuilder newManualTrigger()
   {
      return BpmManualTriggerBuilder.newManualTrigger();
   }

   public static BpmManualTriggerBuilder newManualTrigger(ProcessDefinitionType process)
   {
      return BpmManualTriggerBuilder.newManualTrigger(process);
   }

   public static BpmDataPathBuilder newDataPath(ProcessDefinitionType process)
   {
      return BpmDataPathBuilder.newDataPath(process);
   }

   public static BpmDataPathBuilder newDescriptor(ProcessDefinitionType process)
   {
      return BpmDataPathBuilder.newDescriptor(process);
   }

   public static BpmDataPathBuilder newInDataPath(ProcessDefinitionType process)
   {
      return BpmDataPathBuilder.newInDataPath(process);
   }

   public static BpmDataPathBuilder newOutDataPath(ProcessDefinitionType process)
   {
      return BpmDataPathBuilder.newOutDataPath(process);
   }

   public static BpmRouteActivityBuilder newRouteActivity(ProcessDefinitionType process)
   {
      return AbstractActivityBuilder.newRouteActivity(process);
   }

   public static BpmManualActivityBuilder newManualActivity()
   {
      return AbstractActivityBuilder.newManualActivity();
   }

   public static BpmManualActivityBuilder newManualActivity(ProcessDefinitionType process)
   {
      return AbstractActivityBuilder.newManualActivity(process);
   }

   public static BpmApplicationActivityBuilder newApplicationActivity(ProcessDefinitionType process)
   {
      return AbstractActivityBuilder.newApplicationActivity(process);
   }

   public static BpmInteractiveApplicationActivityBuilder newInteractiveApplicationActivity(ProcessDefinitionType process)
   {
      return AbstractActivityBuilder.newInteractiveApplicationActivity(process);
   }

   public static BpmSubProcessActivityBuilder newSubProcessActivity(ProcessDefinitionType process)
   {
      return AbstractActivityBuilder.newSubProcessActivity(process);
   }

   public static BpmDataMappingBuilder newDataMapping(ActivityType activity)
   {
      return BpmDataMappingBuilder.newDataMapping(activity);
   }

   public static BpmInDataMappingBuilder newInDataMapping()
   {
      return BpmInDataMappingBuilder.newInDataMapping();
   }

   public static BpmInDataMappingBuilder newInDataMapping(ActivityType activity)
   {
      return BpmInDataMappingBuilder.newInDataMapping(activity);
   }

   public static BpmOutDataMappingBuilder newOutDataMapping()
   {
      return BpmOutDataMappingBuilder.newOutDataMapping();
   }

   public static BpmOutDataMappingBuilder newOutDataMapping(ActivityType activity)
   {
      return BpmOutDataMappingBuilder.newOutDataMapping(activity);
   }

   public static BpmConditionalTransitionBuilder newTransition()
   {
      return AbstractTransitionBuilder.newTransition();
   }

   public static BpmConditionalTransitionBuilder newTransition(
         ProcessDefinitionType process)
   {
      return AbstractTransitionBuilder.newTransition(process);
   }

   public static BpmOtherwiseTransitionBuilder newOtherwiseTransition()
   {
      return AbstractTransitionBuilder.newOtherwiseTransition();
   }

   public static BpmOtherwiseTransitionBuilder newOtherwiseTransition(
         ProcessDefinitionType process)
   {
      return AbstractTransitionBuilder.newOtherwiseTransition(process);
   }

   public static BpmActivitySequenceBuilder newActivitySequence()
   {
      return AbstractTransitionBuilder.newActivitySequence();
   }

   public static BpmActivityAssignmentEventHandlerBuilder newActivityAssignmentHandler(
         ActivityType activity)
   {
      return BpmActivityAssignmentEventHandlerBuilder.newActivityAssignmentHandler(activity);
   }

   public static BpmExcludeUserEventActionBuilder newExcludeUserAction(
         EventHandlerType handler)
   {
      return BpmExcludeUserEventActionBuilder.newExcludeUserAction(handler);
   }

   public static BpmDiagramBuilder newProcessDiagram(ProcessDefinitionType process)
   {
      return BpmDiagramBuilder.newProcessDiagram(process);
   }

   public static BpmDiagramBuilder newModelDiagram(ModelType model)
   {
      return BpmDiagramBuilder.newModelDiagram(model);
   }

}