View Javadoc
1   package org.andromda.cartridges.jbpm.metafacades;
2   
3   import org.andromda.cartridges.jbpm.JBpmProfile;
4   import org.andromda.metafacades.uml.UseCaseFacade;
5   import org.andromda.utils.StringUtilsHelper;
6   import org.apache.commons.lang.StringUtils;
7   
8   /**
9    * MetafacadeLogic implementation for org.andromda.cartridges.jbpm.metafacades.JBpmSwimlane.
10   *
11   * @see org.andromda.cartridges.jbpm.metafacades.JBpmSwimlane
12   */
13  public class JBpmSwimlaneLogicImpl
14      extends JBpmSwimlaneLogic
15  {
16      private static final long serialVersionUID = 34L;
17      /**
18       * @param metaObject
19       * @param context
20       */
21      public JBpmSwimlaneLogicImpl(Object metaObject, String context)
22      {
23          super(metaObject, context);
24      }
25  
26      /**
27       * @see org.andromda.cartridges.jbpm.metafacades.JBpmSwimlaneLogic#handleIsContainedInBusinessProcess()
28       */
29      protected boolean handleIsContainedInBusinessProcess()
30      {
31          return this.getActivityGraph().getUseCase() instanceof JBpmProcessDefinition;
32      }
33  
34      /**
35       * @see org.andromda.cartridges.jbpm.metafacades.JBpmSwimlaneLogic#handleGetAssignmentExpression()
36       */
37      protected String handleGetAssignmentExpression()
38      {
39          return (String)findTaggedValue(JBpmProfile.TAGGEDVALUE_ASSIGNMENT_EXPRESSION);
40      }
41  
42      /**
43       * @see org.andromda.cartridges.jbpm.metafacades.JBpmSwimlaneLogic#handleGetClazz()
44       */
45      protected String handleGetClazz()
46      {
47          String assignmentHandlerClass = null;
48  
49          final StringBuilder clazzBuffer = new StringBuilder();
50          if (StringUtils.isNotBlank(this.getAssignmentHandlerPackageName()))
51          {
52              clazzBuffer.append(this.getAssignmentHandlerPackageName());
53              clazzBuffer.append('.');
54          }
55          clazzBuffer.append(this.getAssignmentHandlerClassName());
56          assignmentHandlerClass = clazzBuffer.toString();
57  
58          return assignmentHandlerClass;
59      }
60  
61      /**
62       * @see org.andromda.cartridges.jbpm.metafacades.JBpmSwimlaneLogic#handleGetAssignmentHandlerClassName()
63       */
64      protected String handleGetAssignmentHandlerClassName()
65      {
66          return StringUtilsHelper.upperCamelCaseName(this.getName() + "Assignment");
67      }
68  
69      /**
70       * @see org.andromda.cartridges.jbpm.metafacades.JBpmSwimlaneLogic#handleGetAssignmentHandlerPackageName()
71       */
72      protected String handleGetAssignmentHandlerPackageName()
73      {
74          String packageName = null;
75  
76          final UseCaseFacade useCase = this.getActivityGraph().getUseCase();
77          if (useCase != null)
78          {
79              packageName = useCase.getPackageName();
80          }
81  
82          return packageName;
83      }
84  
85      /**
86       * @see org.andromda.cartridges.jbpm.metafacades.JBpmSwimlaneLogic#handleGetAssignmentHandlerFullPath()
87       */
88      protected String handleGetAssignmentHandlerFullPath()
89      {
90          return StringUtils.replace(this.getClazz(), ".", "/");
91      }
92  }