01: package org.andromda.cartridges.jbpm.metafacades;
02:
03: import org.andromda.cartridges.jbpm.JBpmProfile;
04: import org.andromda.metafacades.uml.UseCaseFacade;
05: import org.andromda.utils.StringUtilsHelper;
06: import org.apache.commons.lang.StringUtils;
07:
08: /**
09: * MetafacadeLogic implementation for org.andromda.cartridges.jbpm.metafacades.JBpmSwimlane.
10: *
11: * @see org.andromda.cartridges.jbpm.metafacades.JBpmSwimlane
12: */
13: public class JBpmSwimlaneLogicImpl extends JBpmSwimlaneLogic {
14: public JBpmSwimlaneLogicImpl(Object metaObject, String context) {
15: super (metaObject, context);
16: }
17:
18: protected boolean handleIsContainedInBusinessProcess() {
19: return this .getActivityGraph().getUseCase() instanceof JBpmProcessDefinition;
20: }
21:
22: protected String handleGetAssignmentExpression() {
23: return (String) findTaggedValue(JBpmProfile.TAGGEDVALUE_ASSIGNMENT_EXPRESSION);
24: }
25:
26: protected String handleGetClazz() {
27: String assignmentHandlerClass = null;
28:
29: final StringBuffer clazzBuffer = new StringBuffer();
30: if (StringUtils.isNotBlank(this
31: .getAssignmentHandlerPackageName())) {
32: clazzBuffer.append(this .getAssignmentHandlerPackageName());
33: clazzBuffer.append('.');
34: }
35: clazzBuffer.append(this .getAssignmentHandlerClassName());
36: assignmentHandlerClass = clazzBuffer.toString();
37:
38: return assignmentHandlerClass;
39: }
40:
41: protected String handleGetAssignmentHandlerClassName() {
42: return StringUtilsHelper.upperCamelCaseName(this .getName()
43: + "Assignment");
44: }
45:
46: protected String handleGetAssignmentHandlerPackageName() {
47: String packageName = null;
48:
49: final UseCaseFacade useCase = this .getActivityGraph()
50: .getUseCase();
51: if (useCase != null) {
52: packageName = useCase.getPackageName();
53: }
54:
55: return packageName;
56: }
57:
58: protected String handleGetAssignmentHandlerFullPath() {
59: return StringUtils.replace(this .getClazz(), ".", "/");
60: }
61: }
|