Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Brayan Osmar Pereyra Suxo
2014-01-06 16:56:17 -04:00
16 changed files with 1077 additions and 5 deletions

View File

@@ -0,0 +1,23 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Dynaforms Resources
Background:
Given that I have a valid access_token
Scenario: Get a List of dynaforms of a project
Given this scenario is not implemented yet
Scenario: Get a single dynaform of a project
Given this scenario is not implemented yet
Scenario: Create a new dynaform for a project
Given this scenario is not implemented yet
Scenario: Create a copy of a dynaform and import it to another project
Given this scenario is not implemented yet
Scenario: Update a dynaform of a project
Given this scenario is not implemented yet
Scenario: Delete a dynaform of a project
Given this scenario is not implemented yet

View File

@@ -0,0 +1,21 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Input Documents Resources
Background:
Given that I have a valid access_token
Scenario: Get a List input documents of a project
Given this scenario is not implemented yet
Scenario: Get a single input document of a project
Given this scenario is not implemented yet
Scenario: Create a new input document for a project
Given this scenario is not implemented yet
Scenario: Update an input document for a project
Given this scenario is not implemented yet
Scenario: Delete an input document of a project
Given this scenario is not implemented yet

View File

@@ -0,0 +1,28 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Output Documents Resources
Background:
Given that I have a valid access_token
Scenario: Get a List output documents of a project
Given I request "project/4224292655297723eb98691001100052/output-documents"
Then the response status code should be 200
And the content type is "application/json"
And the type is "array"
Scenario: Get a single output document of a project
Given I request "project/4224292655297723eb98691001100052/output-document/270088687529c8ace5e5272077582449"
Then the response status code should be 200
And the content type is "application/json"
And the type is "object"
Scenario: Create a new output document for a project
Given this scenario is not implemented yet
Scenario: Update a output document for a project
Given this scenario is not implemented yet
Scenario: Delete a output document of a project
Given this scenario is not implemented yet

View File

@@ -0,0 +1,21 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Project Activity Resources
Background:
Given that I have a valid access_token
Scenario: Get properties & definition of a activity.
Given this scenario is not implemented yet
Scenario: Get BPMN definition of an activity.
Given this scenario is not implemented yet
Scenario: Get properties data of the ProcessMaker engine of an activity.
Given this scenario is not implemented yet
Scenario: Update definition & properties of an activity
Given this scenario is not implemented yet
Scenario: Delete a project activity
Given this scenario is not implemented yet

View File

@@ -0,0 +1,21 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Project Properties - Ad hoc Assignee Resources
Background:
Given that I have a valid access_token
Scenario: List AdHoc assignees of an activity
Given this scenario is not implemented yet
Scenario: Get a list of available AdHoc users and groups to be assigned to an activity
Given this scenario is not implemented yet
Scenario: Get a single AdHoc user or group of an activity
Given this scenario is not implemented yet
Scenario: Assign an AdHoc user or group to an activity
Given this scenario is not implemented yet
Scenario: Remove an AdHoc assignee from an activity
Given this scenario is not implemented yet

View File

@@ -0,0 +1,39 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Project Properties - Step Resources
Background:
Given that I have a valid access_token
Scenario: List assigned steps to an Activity
Given this scenario is not implemented yet
Scenario: List available steps to assign to an Activity
Given this scenario is not implemented yet
Scenario: Get a single step assigned to an Activity
Given this scenario is not implemented yet
Scenario: Assing a step to a Activity
Given this scenario is not implemented yet
Scenario: Unassign a step from an activity
Given this scenario is not implemented yet
Scenario: List assigned triggers to a Step
Given this scenario is not implemented yet
Scenario: List available triggers to assign to a Step
Given this scenario is not implemented yet
Scenario: Get a single trigger assigned to a Step
Given this scenario is not implemented yet
Scenario: Assign a trigger to a Step
Given this scenario is not implemented yet
Scenario: Update a trigger assignation of a Step
Given this scenario is not implemented yet
Scenario: Remove a trigger assignation of a Step
Given this scenario is not implemented yet

View File

@@ -0,0 +1,21 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Project Properties - Assignee Resources
Background:
Given that I have a valid access_token
Scenario: List assignees of an activity
Given this scenario is not implemented yet
Scenario: Get a list of available users and groups to be assigned to an activity
Given this scenario is not implemented yet
Scenario: Get a single user or group of an activity
Given this scenario is not implemented yet
Scenario: Assign a user or group to an activity
Given this scenario is not implemented yet
Scenario: Remove assignee from an activity
Given this scenario is not implemented yet

View File

@@ -0,0 +1,32 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Project Resources
Background:
Given that I have a valid access_token
Scenario: Get a single project
Given I request "project/4224292655297723eb98691001100052"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
Scenario: Create a new project
Given POST data from file "process_template_v1.json"
And I request "project"
Then the response status code should be 201
And the content type is "application/json"
And the type is "array"
Scenario: Update a project
Given PUT data from file "process_template_v2.json"
And I request "project"
Then the response status code should be 201
And the content type is "application/json"
And the type is "array"
Scenario: Delete a project <project_uid>
Given I request "project/<project_uid>"
Then the response status code should be 200

View File

@@ -0,0 +1,13 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Projects End Point.
Lists available projects/processes for an specific workspace
Scenario: Get a list of projects
Given that I have a valid access_token
And I request "projects"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"

View File

@@ -0,0 +1,21 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Triggers Resources
Background:
Given that I have a valid access_token
Scenario: Get a List of triggers of a project
Given this scenario is not implemented yet
Scenario: Get a single trigger of a project
Given this scenario is not implemented yet
Scenario: Create a new trigger for a project
Given this scenario is not implemented yet
Scenario: Update a trigger of a project
Given this scenario is not implemented yet
Scenario: Delete a trigger of a project
Given this scenario is not implemented yet

View File

@@ -2,6 +2,7 @@
use Behat\Behat\Context\BehatContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Behat\Behat\Exception\PendingException;
/**
* Rest context.
*
@@ -936,6 +937,8 @@ class RestContext extends BehatContext
$this->_headers['Content-Type'] = 'application/json; charset=UTF-8';
$this->_requestBody = $string;
}
/**
@@ -972,6 +975,7 @@ class RestContext extends BehatContext
$sessionData->$varName = $varValue;
file_put_contents("session.data", json_encode($sessionData));
}
/**
* @Then /^echo last response$/
@@ -980,5 +984,55 @@ class RestContext extends BehatContext
{
$this->printDebug("$this->_request\n$this->_response");
}
//*********** WEN
/**
* @Given /^POST data from file "([^"]*)"$/
*/
public function postDataFromFile($jsonFile)
{
$filePath = __DIR__ . "/../json/" . $jsonFile;
if(file_exists($filePath))
{
$fileData = file_get_contents($filePath);
$this->postThisData(new PyStringNode($fileData));
}
else
{
throw new \Exception("JSON File: $filePath not found\n\n" );
}
// throw new PendingException();
}
/**
* @Given /^PUT data from file "([^"]*)"$/
*/
public function putDataFromFile($jsonFile)
{
$filePath = __DIR__ . "/../json/" . $jsonFile;
if(file_exists($filePath))
{
$fileData = file_get_contents($filePath);
$this->putThisData(new PyStringNode($fileData));
}
else
{
throw new \Exception("JSON File: $filePath not found\n\n" );
}
// throw new PendingException();
}
/**
* @Given /^This scenario is not implemented yet$/
* @Given /^this scenario is not implemented yet$/
*/
public function thisScenarioIsNotImplementedYet()
{
throw new PendingException();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -296,7 +296,7 @@ class DynaForm
$processUid = $arrayDataUid["PRO_UID"];
//Verify data
if (!$this->dynaFormAssignedStep($dynaFormUid, $processUid)) {
if ($this->dynaFormAssignedStep($dynaFormUid, $processUid)) {
throw (new \Exception("You cannot delete this Dynaform while it is assigned to a step"));
}

View File

@@ -186,7 +186,7 @@ class OutputDocument
$aRow['OUT_DOC_TITLE'] = $outputDocumentObj['OUT_DOC_TITLE'];
$aRow['OUT_DOC_DESCRIPTION'] = $outputDocumentObj['OUT_DOC_DESCRIPTION'];
} else {
$outputDocArray[] = array('out_doc_uid' => $aRow['OUT_DOC_UID'],
$outputDocArray = array('out_doc_uid' => $aRow['OUT_DOC_UID'],
'out_doc_title' => $aRow['OUT_DOC_TITLE'],
'out_doc_description' => $aRow['OUT_DOC_DESCRIPTION'],
'out_doc_filename' => $aRow['OUT_DOC_FILENAME'],

View File

@@ -296,5 +296,44 @@ class ProcessSupervisor
}
}
/**
* Assign a supervisor of a process
*
* @param string $sProcessUID
* @param string $sUsrUID
* @param string $sTypeUID
* @access public
*/
public function addSupervisor($sProcessUID, $sUsrUID, $sTypeUID)
{
$oProcessUser = new \ProcessUser ( );
$puType = 'SUPERVISOR';
if ($sTypeUID == 'Group') {
$puType = 'GROUP_SUPERVISOR';
}
$oTypeAssigneeG = \GroupwfPeer::retrieveByPK( $sUsrUID );
$oTypeAssigneeU = \UsersPeer::retrieveByPK( $sUsrUID );
if (is_null( $oTypeAssigneeG ) && is_null( $oTypeAssigneeU ) ) {
throw (new \Exception( 'This id: '. $sUsrUID .' do not correspond to a registered ' .$sTypeUID ));
}
if (is_null( $oTypeAssigneeG ) && ! is_null( $oTypeAssigneeU) ) {
$type = "user";
if ( $type != $assType ) {
throw (new \Exception( 'This id: '. $sUsrUID .' do not correspond to a registered ' .$sTypeUID ));
}
}
if (! is_null( $oTypeAssigneeG ) && is_null( $oTypeAssigneeU ) ) {
$type = "group";
if ( $type != $assType ) {
throw (new \Exception( 'This id: '. $sUsrUID .' do not correspond to a registered ' .$sTypeUID ));
}
}
$oProcessUser->create(array('PU_UID' => \G::generateUniqueID(), 'PRO_UID' => $sProcessUID, 'USR_UID' => $sUsrUID, 'PU_TYPE' => $puType));
}
}

View File

@@ -19,7 +19,7 @@ class ProcessSupervisors extends Api
*
* @url GET /:prjUid/supervisors
*/
public function doGetProjectSupervisors($prjUid, $filter = '', $start = null, $limit = null)
public function doGetSupervisors($prjUid, $filter = '', $start = null, $limit = null)
{
try {
$supervisor = new \BusinessModel\ProcessSupervisor();
@@ -38,7 +38,7 @@ class ProcessSupervisors extends Api
*
* @url GET /:prjUid/inputdocument-supervisor
*/
public function doGetProjectInputDocumentSupervisor($prjUid)
public function doGetInputDocumentSupervisor($prjUid)
{
try {
$supervisor = new \BusinessModel\ProcessSupervisor();
@@ -57,7 +57,7 @@ class ProcessSupervisors extends Api
*
* @url GET /:prjUid/dynaform-supervisor
*/
public function doGetProjectDynaformSupervisor($prjUid)
public function doGetDynaformSupervisor($prjUid)
{
try {
$supervisor = new \BusinessModel\ProcessSupervisor();
@@ -128,4 +128,28 @@ class ProcessSupervisors extends Api
return $response;
}
/**
* @url POST /:prjUid/supervisor
*
* @param string $prjUid
* @param string $sup_uid
* @param string $sup_type {@choice user,group}
*
* @status 201
*/
public function doPostSupervisors($prjUid, $sup_uid, $sup_type)
{
try {
$supervisor = new \BusinessModel\ProcessSupervisor();
$sup_type=ucwords($sup_type);
$arrayData = $supervisor->addSupervisor($prjUid, $sup_uid, $sup_type);
} catch (\Exception $e) {
//Response
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
return $response;
}
}