Convert "closed" polyline to polygon with JS API 3.2

Discussion created by jorge.vinagreesri-portugal-pt-esridist Employee on Jun 2, 2014
I have this scenario(requirements):

  1. In a web app that uses JS API (3.2) there are two layers, one of the polyline type and other a polygon type.

  2. Users should be able to select a geometry from the polyline layer and "insert it" into the polygon layer.

  3. The application should should validate if the selected polyline is "closed", convert it to a polygon and persist it into the polygon layer

Any directions on this?
I dont know which part of the api can do this