Merged in victorsl/processmaker (pull request #145)

ProcessMaker-MA "Process of a Project Resources (endpoints & behat)"
This commit is contained in:
erik ao
2014-02-04 17:53:18 -04:00
4 changed files with 682 additions and 2 deletions

View File

@@ -0,0 +1,51 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Process of a Project Resources
Requirements:
a workspace with the process 14414793652a5d718b65590036026581 ("Sample Project #1") already loaded
there are three activities in the process
Background:
Given that I have a valid access_token
#GET /api/1.0/{workspace}/project/{prj_uid}/process
# Get a single Process
Scenario Outline: Get a single Process
Given that I want to get a resource with the key "obj_uid" stored in session array
And I request "project/14414793652a5d718b65590036026581/process"
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 "pro_title" is set to "<pro_title>"
And that "pro_description" is set to "<pro_description>"
And that "pro_status" is set to "<pro_status>"
And that "pro_create_user" is set to "<pro_create_user>"
And that "pro_debug" is set to "<pro_debug>"
Examples:
| pro_title | pro_description | pro_status | pro_create_user | pro_debug |
| Sample Project #1 | | ACTIVE | 00000000000000000000000000000001 | 0 |
#PUT /api/1.0/{workspace}/project/{prj_uid}/process
# Update Process
Scenario Outline: Update Process
Given PUT this data:
"""
{
"pro_title": "<pro_title>",
"pro_description": "<pro_description>",
"pro_status": "<pro_status>",
"pro_create_user": "<pro_create_user>",
"pro_debug": <pro_debug>
}
"""
And I request "project/14414793652a5d718b65590036026581/process"
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:
| pro_title | pro_description | pro_status | pro_create_user | pro_debug |
| Sample Project #1 | | ACTIVE | 00000000000000000000000000000001 | 0 |

View File

@@ -65,7 +65,7 @@ class Group
/**
* Verify if exists the title of a Group
*
* @param string $title Title
* @param string $groupTitle Title
* @param string $groupUidExclude Unique id of Group to exclude
*
* return bool Return true if exists the title of a Group, false otherwise
@@ -146,7 +146,7 @@ class Group
/**
* Verify if exists the title of a Group
*
* @param string $title Title
* @param string $groupTitle Title
* @param string $groupUidExclude Unique id of Group to exclude
*
* return void Throw exception if exists the title of a Group

File diff suppressed because it is too large Load Diff

View File

@@ -97,6 +97,45 @@ class Project extends Api
}
}
/**
* @url GET /:prj_uid/process
*
* @param string $prj_uid {@min 32}{@max 32}
*/
public function doGetProcess($prj_uid)
{
try {
$process = new \BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid"));
$response = $process->getProcess($prj_uid);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @url PUT /:prj_uid/process
*
* @param string $prj_uid {@min 32}{@max 32}
* @param array $request_data
*/
public function doPutProcess($prj_uid, $request_data)
{
try {
$process = new \BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid"));
$arrayData = $process->update($prj_uid, $request_data);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @url GET /:projectUid/dynaforms
*/