documentation - Flow for conditionals inside sequence diagram -
i need document in uml sequence diagram method setrepresentative
. code method:
class reptoolcontroller extends pagecontroller { private function setrepresentative($request, $action, $case) { ... $repappconfig = new repappconfig(); $repappconfig = $this->getdoctrine()->getrepository('appbundle:repappconfig')->findoneby(array("app_id"=>$id)); $project_id = $repappconfig->getprojectid(); $company_id = $repappconfig->getcompanyid(); $project = $this->getdoctrine()->getrepository('appbundle:project')->find($project_id); $brand = $this->getdoctrine()->getrepository('appbundle:brand')->findoneby(array("project"=>$project_id)); $company = $this->getdoctrine()->getrepository('appbundle:company')->find($company_id); $territory = new territory(); if(is_numeric($territory_name)) { $tempname = "id"; } else { $tempname = "territory"; } if($territory = $this->getdoctrine()->getrepository('appbundle:territory')->findoneby(array($tempname=>$territory_name))) { $territory_id = $territory->getid(); $response->territory_id = $territory_id; if($brand) { $is_enabled = 1; $position = 1; $brand_id = $brand->getid(); $terr_brand_xrf = $this->getdoctrine()->getrepository('appbundle:territorybrandxref')->findoneby(array("territory"=>$territory_id, "brand"=>$brand_id)); if(!$terr_brand_xrf) { $terr_brand_xref = new territorybrandxref($territory,$brand,$position); $terr_brand_xref->setisenabled($is_enabled); $terr_brand_xref->updatetimestamps(); $em = $this->getdoctrine()->getentitymanager(); $em->persist($terr_brand_xref); $em->flush(); } } } else { $territory->setterritory($territory_name); $territory->setproject($project); $em = $this->getdoctrine()->getentitymanager(); $em->persist($territory); $em->flush(); $territory_id = $territory->getid(); $response->territory_id = $territory_id; if($brand) { $is_enabled = 1; $position = 1; $brand_id = $brand->getid(); $response->brand_id= $brand_id; $terr_brand_xref = new territorybrandxref($territory,$brand,$position); $terr_brand_xref->setisenabled($is_enabled); $terr_brand_xref->updatetimestamps(); $em = $this->getdoctrine()->getentitymanager(); $em->persist($terr_brand_xref); $em->flush(); } } $controller_response = new response( json_encode($response) ); $controller_response->headers->set('content-type', 'application/json; charset=utf-8'); return $controller_response; } }
this diagram have now:
how diagram conditionals inside piece of code:
if($territory = $this->getdoctrine()->getrepository('pdonebundle:territory')->findoneby(array($tempname=>$territory_name))) { ... } else { ... }
how call inside methods?
actually asking not make sense (see comment here: uml sequence diagram needed). sds not meant repeat algorithms in graphical notation. code better purpose. possibility show loops , if conditions inside sds meant used high level view of system.
in case should concentrate on aspects of runtime. important snapshot. create sd tech use case sequential message flow. create more 1 sd light different aspects. not try press whole algorithm in single sd.
Comments
Post a Comment