@@ -137,48 +137,36 @@ def parse(self, element):
137
137
super (ServiceTask , self ).parse (element )
138
138
for ee in element .findall (".//bpmn:extensionElements" , NS ):
139
139
#Find direct children inputOutput, Input/Output tab in Camunda
140
- self .parse_input_output_variables (ee , self .input_variables , self .output_variables )
140
+ self ._parse_input_output_variables (ee , self .input_variables , self .output_variables )
141
141
#Find connector data, Connector tab in Camunda
142
142
for con in ee .findall (".camunda:connector" , NS ):
143
- self .parse_input_output_variables (con , self .connector_fields ["input_variables" ], self .connector_fields ["output_variables" ])
143
+ self ._parse_input_output_variables (con , self .connector_fields ["input_variables" ], self .connector_fields ["output_variables" ])
144
144
self .connector_fields ["connector_id" ] = con .find ("camunda:connectorId" ,NS ).text
145
-
146
- #Find all property fields
147
- for f in element .findall (".//camunda:property" ,NS ):
148
- if ',' in f .attrib ["value" ]:
149
- self .properties_fields [f .attrib ["name" ]] = list (f .attrib ["value" ].split (',' ))
150
- else :
151
- self .properties_fields [f .attrib ["name" ]] = f .attrib ["value" ]
152
-
153
- @staticmethod
154
- def parse_input_output_variables (element , input_dict , output_dict ):
145
+
146
+ def _parse_input_output_variables (self , element , input_dict , output_dict ):
155
147
for io in element .findall (".camunda:inputOutput" ,NS ):
156
148
for inparam in io .findall (".camunda:inputParameter" ,NS ):
157
- if inparam .findall (".camunda:list" ,NS ):
158
- helper_list = []
159
- for lv in inparam .find ("camunda:list" ,NS ):
160
- helper_list .append (lv .text )
161
- input_dict [inparam .attrib ["name" ]] = helper_list
162
- elif inparam .findall (".camunda:map" ,NS ):
163
- helper_dict = {}
164
- for mv in inparam .find ("camunda:map" ,NS ):
165
- helper_dict [mv .attrib ["key" ]] = mv .text
166
- input_dict [inparam .attrib ["name" ]] = helper_dict
167
- elif inparam .findall (".camunda:script" ,NS ):
168
- #script not supported
169
- pass
170
- else :
171
- input_dict [inparam .attrib ["name" ]] = inparam .text if inparam .text else ""
149
+ self .parse_input_output_parameters (inparam , input_dict )
172
150
for outparam in io .findall (".camunda:outputParameter" ,NS ):
173
- if outparam .findall (".camunda:map" ,NS ):
174
- output_dict [outparam .attrib ["name" ]]= {}
175
- elif outparam .findall (".camunda:list" ,NS ):
176
- output_dict [outparam .attrib ["name" ]]= []
177
- elif outparam .findall (".camunda:script" ,NS ):
178
- #script not supported
179
- pass
180
- else :
181
- output_dict [outparam .attrib ["name" ]]= ""
151
+ self .parse_input_output_parameters (outparam , output_dict )
152
+
153
+ def _parse_input_output_parameters (self , element , dictionary ):
154
+ if element .findall (".camunda:list" ,NS ):
155
+ helper_list = []
156
+ for lv in element .find ("camunda:list" ,NS ):
157
+ helper_list .append (lv .text ) if lv .text else ""
158
+ dictionary [element .attrib ["name" ]] = helper_list
159
+ elif element .findall (".camunda:map" ,NS ):
160
+ helper_dict = {}
161
+ for mv in element .find ("camunda:map" ,NS ):
162
+ helper_dict [mv .attrib ["key" ]] = mv .text
163
+ dictionary [element .attrib ["name" ]] = helper_dict
164
+ elif element .findall (".camunda:script" ,NS ):
165
+ #script not supported
166
+ pass
167
+ else :
168
+ dictionary [element .attrib ["name" ]] = element .text if element .text else ""
169
+
182
170
183
171
def run_connector (self , variables , instance_id ):
184
172
#Check for URL parameters
@@ -243,6 +231,13 @@ def parse(self, element):
243
231
if element .attrib .get (f"{{{ NS ['camunda' ]} }}calledElementBinding" ) and element .attrib .get (f"{{{ NS ['camunda' ]} }}calledElementBinding" ) == "deployment" :
244
232
self .deployment = True
245
233
234
+ @bpmn_tag ("bpmn:businessRule" )
235
+ class BusinessRule (ServiceTask ):
236
+ def __init__ (self ):
237
+ self .decision_ref = None
238
+ def parse (self , element ):
239
+ super (BusinessRule , self ).parse (element )
240
+
246
241
@bpmn_tag ("bpmn:event" )
247
242
class Event (BpmnObject ):
248
243
pass
0 commit comments