diff --git a/features/backend/web_entry/basic_sequence.feature b/features/backend/web_entry/basic_sequence.feature new file mode 100644 index 000000000..d385dd901 --- /dev/null +++ b/features/backend/web_entry/basic_sequence.feature @@ -0,0 +1,207 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Web Entry + Requirements: + Default user "admin" with password "admin" + + Background: + Given that I have a valid access_token + + #GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/assignee?filter=john&start=0&limit=50 + # List assignees of an activity + Scenario Outline: List assignees of an activity + Given I request "project/28733629952e66a362c4f63066393844/activity//assignee" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the json data is an empty array + + Examples: + | tas_uid | tas_title | + | 44199549652e66ba533bb06088252754 | Task 1 | + | 56118778152e66babcc2103002009439 | Task 2 | + | 18096002352e66bc1643af8048493068 | Task 3 | + + #POST /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/assignee + # Assign a user or group to an activity + Scenario Outline: Assign a user or group to an activity + Given POST this data: + """ + { + "aas_uid": "", + "aas_type": "user" + } + """ + And I request "project/28733629952e66a362c4f63066393844/activity//assignee" + And the content type is "application/json" + Then the response status code should be 201 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + | tas_uid | tas_title | aas_uid | + | 44199549652e66ba533bb06088252754 | Task 1 | 00000000000000000000000000000001 | + | 56118778152e66babcc2103002009439 | Task 2 | 00000000000000000000000000000001 | + | 18096002352e66bc1643af8048493068 | Task 3 | 00000000000000000000000000000001 | + + #WEB ENTRY + + #GET /api/1.0/{workspace}/project/{prj_uid}/web-entries + # Get list Web Entries of a Project + Scenario: Get list Web Entries of a Project + And I request "project/28733629952e66a362c4f63066393844/web-entries" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the json data is an empty array + + #POST /api/1.0/{workspace}/project/{prj_uid}/web-entry + # Create a new Web Entry for a project + # Create a new Web Entry using the method: PHP pages with Web Services + Scenario Outline: Create a new Web Entry using the method: PHP pages with Web Services + Given POST this data: + """ + { + "tas_uid": "", + "dyn_uid": "", + "method": "WS", + "input_document_access": 1, + "usr_username": "admin", + "usr_password": "admin" + } + """ + And I request "project/28733629952e66a362c4f63066393844/web-entry" + And the content type is "application/json" + Then the response status code should be 201 + And the response charset is "UTF-8" + And the type is "object" + And the response has a "url" property + And the "url" property type is "string" + + Examples: + | tas_uid | tas_title | dyn_uid | dyn_title | + | 44199549652e66ba533bb06088252754 | Task 1 | 60308801852e66b7181ae21045247174 |DynaForm Demo1 | + | 56118778152e66babcc2103002009439 | Task 2 | 99869771852e66b7dc4b858088901665 |DynaForm Demo2 | + + #POST /api/1.0/{workspace}/project/{prj_uid}/web-entry + # Create a new Web Entry for a project + # Create a new Web Entry using the method: Single HTML + Scenario Outline: Create a new Web Entry using the method: Single HTML + Given POST this data: + """ + { + "tas_uid": "", + "dyn_uid": "", + "method": "HTML", + "input_document_access": 1 + } + """ + And I request "project/28733629952e66a362c4f63066393844/web-entry" + And the content type is "application/json" + Then the response status code should be 201 + And the response charset is "UTF-8" + And the type is "object" + And the response has a "html" property + And the "html" property type is "string" + + Examples: + | tas_uid | tas_title | dyn_uid | dyn_title | + | 18096002352e66bc1643af8048493068 | Task 3 | 37977455352e66b892babe6071295002 |DynaForm Demo3 | + + #GET /api/1.0/{workspace}/project/{prj_uid}/web-entries + # Get list Web Entries of a Project + Scenario Outline: Get list Web Entries of a Project + And I request "project/28733629952e66a362c4f63066393844/web-entries" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the "tas_uid" property in row equals "" + And the "tas_title" property in row equals "" + And the "dyn_uid" property in row equals "" + And the "dyn_title" property in row equals "" + + Examples: + | i | tas_uid | tas_title | dyn_uid | dyn_title | + | 0 | 44199549652e66ba533bb06088252754 | Task 1 | 60308801852e66b7181ae21045247174 |DynaForm Demo1 | + | 1 | 56118778152e66babcc2103002009439 | Task 2 | 99869771852e66b7dc4b858088901665 |DynaForm Demo2 | + + #GET GET /api/1.0/{workspace}/project/{prj_uid}/web-entry/{tas_uid}/{dyn_uid} + # Get a single Web Entry of a Project + Scenario Outline: Get a single Web Entry of a Project + Given that I want to get a resource with the key "obj_uid" stored in session array + And I request "project/28733629952e66a362c4f63066393844/web-entry//" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + And that "tas_uid" is set to "" + And that "tas_title" is set to "" + And that "dyn_uid" is set to "" + And that "dyn_title" is set to "" + + Examples: + | tas_uid | tas_title | dyn_uid | dyn_title | + | 44199549652e66ba533bb06088252754 | Task 1 | 60308801852e66b7181ae21045247174 |DynaForm Demo1 | + | 56118778152e66babcc2103002009439 | Task 2 | 99869771852e66b7dc4b858088901665 |DynaForm Demo2 | + + #DELETE /api/1.0/{workspace}/project/{prj_uid}/web-entry/{tas_uid}/{dyn_uid} + # Delete a Web Entry of a Project + Scenario Outline: Delete a Web Entry of a Project + Given that I want to delete a resource with the key "obj_uid" stored in session array + And I request "project/28733629952e66a362c4f63066393844/web-entry//" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + | tas_uid | tas_title | dyn_uid | dyn_title | + | 44199549652e66ba533bb06088252754 | Task 1 | 60308801852e66b7181ae21045247174 |DynaForm Demo1 | + | 56118778152e66babcc2103002009439 | Task 2 | 99869771852e66b7dc4b858088901665 |DynaForm Demo2 | + + #GET /api/1.0/{workspace}/project/{prj_uid}/web-entries + # Get list Web Entries of a Project + Scenario: Get list Web Entries of a Project + And I request "project/28733629952e66a362c4f63066393844/web-entries" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the json data is an empty array + + #WEB ENTRY - END + + #DELETE /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/assignee/{aas_uid} + # Remove an assignee of an activity + Scenario Outline: Remove an assignee of an activity + Given that I want to delete a resource with the key "obj_uid" stored in session array + And I request "project/28733629952e66a362c4f63066393844/activity//assignee/" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + | tas_uid | tas_title | aas_uid | + | 44199549652e66ba533bb06088252754 | Task 1 | 00000000000000000000000000000001 | + | 56118778152e66babcc2103002009439 | Task 2 | 00000000000000000000000000000001 | + | 18096002352e66bc1643af8048493068 | Task 3 | 00000000000000000000000000000001 | + + #GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/assignee?filter=john&start=0&limit=50 + # List assignees of an activity + Scenario Outline: List assignees of an activity + Given I request "project/28733629952e66a362c4f63066393844/activity//assignee" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the json data is an empty array + + Examples: + | tas_uid | tas_title | + | 44199549652e66ba533bb06088252754 | Task 1 | + | 56118778152e66babcc2103002009439 | Task 2 | + | 18096002352e66bc1643af8048493068 | Task 3 | + diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project.php b/workflow/engine/src/Services/Api/ProcessMaker/Project.php index 374c80dcf..c22829006 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project.php @@ -209,16 +209,16 @@ class Project extends Api } /** - * @url GET /:projectUid/web-entries + * @url GET /:prj_uid/web-entries * - * @param string $projectUid {@min 32}{@max 32} + * @param string $prj_uid {@min 32}{@max 32} */ - public function doGetWebEntries($projectUid) + public function doGetWebEntries($prj_uid) { try { $process = new \BusinessModel\Process(); - $response = $process->getWebEntries($projectUid); + $response = $process->getWebEntries($prj_uid); return $response; } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php b/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php index 410a45acb..89351ad4b 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php @@ -35,10 +35,10 @@ class InputDocument extends Api * * @param string $projectUid {@min 32}{@max 32} * @param array $request_data - * @param string $inp_doc_title {@from body} + * @param string $inp_doc_title {@from body}{@required true} * @param string $inp_doc_description {@from body} * @param string $inp_doc_form_needed {@from body}{@choice VIRTUAL,REAL,VREAL} - * @param string $inp_doc_original {@from body}{@choice ORIGINAL,COPY} + * @param string $inp_doc_original {@from body}{@choice ORIGINAL,COPY,COPYLEGAL} * @param string $inp_doc_published {@from body}{@choice PRIVATE} * @param int $inp_doc_versioning {@from body}{@choice 0,1} * @param string $inp_doc_destination_path {@from body} @@ -80,7 +80,7 @@ class InputDocument extends Api * @param string $inp_doc_title {@from body} * @param string $inp_doc_description {@from body} * @param string $inp_doc_form_needed {@from body}{@choice VIRTUAL,REAL,VREAL} - * @param string $inp_doc_original {@from body}{@choice ORIGINAL,COPY} + * @param string $inp_doc_original {@from body}{@choice ORIGINAL,COPY,COPYLEGAL} * @param string $inp_doc_published {@from body}{@choice PRIVATE} * @param int $inp_doc_versioning {@from body}{@choice 0,1} * @param string $inp_doc_destination_path {@from body} diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php b/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php index 06c61f7ba..2256522cb 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php @@ -12,18 +12,18 @@ use \Luracast\Restler\RestException; class WebEntry extends Api { /** - * @url GET /:projectUid/web-entry/:activityUid/:dynaFormUid + * @url GET /:prj_uid/web-entry/:tas_uid/:dyn_uid * - * @param string $dynaFormUid {@min 32}{@max 32} - * @param string $activityUid {@min 32}{@max 32} - * @param string $projectUid {@min 32}{@max 32} + * @param string $dyn_uid {@min 32}{@max 32} + * @param string $tas_uid {@min 32}{@max 32} + * @param string $prj_uid {@min 32}{@max 32} */ - public function doGetWebEntry($dynaFormUid, $activityUid, $projectUid) + public function doGetWebEntry($dyn_uid, $tas_uid, $prj_uid) { try { $webEntry = new \BusinessModel\WebEntry(); - $response = $webEntry->getWebEntry($projectUid, $activityUid, $dynaFormUid); + $response = $webEntry->getWebEntry($prj_uid, $tas_uid, $dyn_uid); return $response; } catch (\Exception $e) { @@ -32,9 +32,9 @@ class WebEntry extends Api } /** - * @url POST /:projectUid/web-entry + * @url POST /:prj_uid/web-entry * - * @param string $projectUid {@min 32}{@max 32} + * @param string $prj_uid {@min 32}{@max 32} * @param array $request_data * @param string $tas_uid {@from body}{@min 32}{@max 32}{@required true} * @param string $dyn_uid {@from body}{@min 32}{@max 32}{@required true} @@ -46,7 +46,7 @@ class WebEntry extends Api * @status 201 */ public function doPostWebEntry( - $projectUid, + $prj_uid, $request_data, $tas_uid = "00000000000000000000000000000000", $dyn_uid = "00000000000000000000000000000000", @@ -58,7 +58,7 @@ class WebEntry extends Api try { $webEntry = new \BusinessModel\WebEntry(); - $arrayData = $webEntry->create($projectUid, $request_data); + $arrayData = $webEntry->create($prj_uid, $request_data); $response = $arrayData; @@ -69,18 +69,18 @@ class WebEntry extends Api } /** - * @url DELETE /:projectUid/web-entry/:activityUid/:dynaFormUid + * @url DELETE /:prj_uid/web-entry/:tas_uid/:dyn_uid * - * @param string $dynaFormUid {@min 32}{@max 32} - * @param string $activityUid {@min 32}{@max 32} - * @param string $projectUid {@min 32}{@max 32} + * @param string $dyn_uid {@min 32}{@max 32} + * @param string $tas_uid {@min 32}{@max 32} + * @param string $prj_uid {@min 32}{@max 32} */ - public function doDeleteWebEntry($dynaFormUid, $activityUid, $projectUid) + public function doDeleteWebEntry($dyn_uid, $tas_uid, $prj_uid) { try { $webEntry = new \BusinessModel\WebEntry(); - $webEntry->delete($projectUid, $activityUid, $dynaFormUid); + $webEntry->delete($prj_uid, $tas_uid, $dyn_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); }