Module: Muml_Class

Defined in:
lib/ontomde-uml2-jpdl/processOperationToClass.rb

Instance Method Summary collapse

Instance Method Details

#bpm_asyncMethods(biz) ⇒ Object



188
189
190
191
# File 'lib/ontomde-uml2-jpdl/processOperationToClass.rb', line 188

def bpm_asyncMethods(biz)
  biz.java_annotation_add(%{@xmda.bpm.async.Async})
  bpm_manageAsynchronousMethods(biz, true)
end

#bpm_callbackMethods(biz) ⇒ Object

Ajoute une m�thode utilitaire pour r�cup�rer un handler correspondant � la m�thode



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
# File 'lib/ontomde-uml2-jpdl/processOperationToClass.rb', line 119

def bpm_callbackMethods(biz)
  c=self
  p=c.umlx_package
  if p.nil?
    log.error{"Model modification required !!! class #{c} is in root model element. Classes should be in a package."}
    next
  end
  biz.java_annotation_add(%{@xmda.common.Callback})
  type_callback=biz.bpm_callbackType

  m=c.umlx_createAndAddOperation(biz.rdf_uri+"_handler","getOntomdeHandlerFor#{biz.uml_name}")#+self.java_NameBean)
  m.uml_isStatic=RDF_TRUE
  #m.uml_class=self
  m.uml_visibility=Cuml_VisibilityKind::Public
  #m.uml_isStatic=RDF_TRUE

  param=m.umlx_createAndAddParameter(m.rdf_uri+"_this","_this")
  i=c.umlx_getOrCreateInterface(DB::EntityInterface)
  i.java_isGeneric=RDF_TRUE
  param.uml_type=i
  param.uml_direction=Cuml_ParameterDirectionKind::In
  param.uml_upperValue=umlx_literal(1)
  param.uml_lowerValue=umlx_literal(1)

  rp=m.umlx_createAndAddParameter(m.rdf_uri+"_ret_param","return")
  rp.uml_direction=Cuml_ParameterDirectionKind::Return
  rp.uml_upperValue=umlx_literal(1)
  rp.uml_lowerValue=umlx_literal(1)
  i=c.umlx_getOrCreateInterface("xmda.bpm.api.XmdaCallbackHandler<#{type_callback}>")
  i.java_isGeneric=RDF_TRUE
  rp.uml_type=i
  rp.uml_isOrdered=RDF_TRUE

  m.java_annotation_add(%{@SuppressWarnings("unchecked")})

  m.java_code=<<END_OF_STRING
  return JmsCallbackHandler.Factory.createCallbackHandler(xmda.bpm.async.AsyncUtils.createAsyncTaskDescription(_this,"#{biz.uml_name}", new String[] {#{type_callback}.class.getName()}));
END_OF_STRING

end

#bpm_manageAsynchronousMethods(biz, not_delete_param = false) ⇒ Object



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
# File 'lib/ontomde-uml2-jpdl/processOperationToClass.rb', line 160

def bpm_manageAsynchronousMethods(biz, not_delete_param=false)
  returnParam = nil
  biz.uml_returnResult.each { |p|
    #pour RSM (non conformite de l'export)
    next unless p.uml_direction_one.isReturn?
    returnParam=p
    biz.uml_returnResult.delete(p) if !not_delete_param
  }
  biz.uml_ownedParameter.each { |p|
    next unless p.uml_direction_one.isReturn?
    returnParam=p
    biz.uml_ownedParameter.delete(p) if !not_delete_param
  }
  return if returnParam.nil?

  downcaseName=biz.uml_name_one0
  if downcaseName[0..0].downcase!=downcaseName[0..0]
    downcaseName="#{downcaseName[0..0].downcase}#{downcaseName[1,downcaseName.length]}"
  end

  param=biz.umlx_createAndAddParameter(biz.rdf_uri+"_handler_param","handler")
  i=self.umlx_getOrCreateInterface("xmda.bpm.api.XmdaCallbackHandler<#{returnParam.uml_type}>")
  i.java_isGeneric=RDF_TRUE
  param.uml_type=i
  param.uml_direction=Cuml_ParameterDirectionKind::In
end

#jpa_addStdImports!Object



106
107
108
109
110
111
112
113
114
115
116
# File 'lib/ontomde-uml2-jpdl/processOperationToClass.rb', line 106

def jpa_addStdImports!
  super_jpa_addStdImports!

  java_import_add("xmda.bpm.api.XmdaCallbackHandler")
  java_import_add("xmda.bpm.api.client.EntityInstanceDescription")
  java_import_add("xmda.bpm.api.client.EntityTaskDescription")
  java_import_add("xmda.bpm.api.client.EntityTaskWithoutCallbackDescription")
  java_import_add("xmda.bpm.api.jms.JmsCallbackHandler")
  java_import_add(::DB::EntityGenericInterface)

end

#super_jpa_addStdImports!Object



105
# File 'lib/ontomde-uml2-jpdl/processOperationToClass.rb', line 105

alias super_jpa_addStdImports! jpa_addStdImports!