BUG 11830 "Remover la funcion WSDL Web Services..." SOLVED

- Remover la funcion WSDL Web Services Functions importProcessFromLibrary()
- Problema resuelto, se ha eliminado la Funcion "importProcessFromLibrary()", ya no existe.
This commit is contained in:
Luis Fernando Saisa Lopez
2013-09-02 09:34:33 -04:00
parent 2525957efb
commit 3fd9699a49
7 changed files with 1 additions and 270 deletions

View File

@@ -665,37 +665,6 @@ class classwsBaseTest extends PHPUnit_Framework_TestCase
$params = $r->getParameters(); $params = $r->getParameters();
} }
/**
* @covers wsBase::importProcessFromLibrary
* @todo Implement testimportProcessFromLibrary().
*/
public function testimportProcessFromLibrary()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('importProcessFromLibrary', $methods ), 'exists method importProcessFromLibrary' );
$r = new ReflectionMethod('wsBase', 'importProcessFromLibrary');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'processId');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'version');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '');
$this->assertTrue( $params[2]->getName() == 'importOption');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == '');
$this->assertTrue( $params[3]->getName() == 'usernameLibrary');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == '');
$this->assertTrue( $params[4]->getName() == 'passwordLibrary');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == true);
$this->assertTrue( $params[4]->getDefaultValue() == '');
}
/** /**
* @covers wsBase::getCaseNotes * @covers wsBase::getCaseNotes
* @todo Implement testgetCaseNotes(). * @todo Implement testgetCaseNotes().

View File

@@ -2940,137 +2940,6 @@ class wsBase
* @param string passwordLibrary : The password to obtain access to the ProcessMaker library. * @param string passwordLibrary : The password to obtain access to the ProcessMaker library.
* @return $eturns will return an object * @return $eturns will return an object
*/ */
public function importProcessFromLibrary ($processId, $version = '', $importOption = '', $usernameLibrary = '', $passwordLibrary = '')
{
try {
G::LoadClass( 'processes' );
//$versionReq = $_GET['v'];
//. (isset($_GET['s']) ? '&s=' . $_GET['s'] : '')
$ipaddress = $_SERVER['REMOTE_ADDR'];
$oProcesses = new Processes();
$oProcesses->ws_open_public();
$oProcess = $oProcesses->ws_processGetData( $processId );
if ($oProcess->status_code != 0) {
throw (new Exception( $oProcess->message ));
}
$privacy = $oProcess->privacy;
$strSession = '';
if ($privacy != 'FREE') {
global $sessionId;
$antSession = $sessionId;
$oProcesses->ws_open( $usernameLibrary, $passwordLibrary );
$strSession = "&s=" . $sessionId;
$sessionId = $antSession;
}
//downloading the file
$localPath = PATH_DOCUMENT . 'input' . PATH_SEP;
G::mk_dir( $localPath );
$newfilename = G::GenerateUniqueId() . '.pm';
$downloadUrl = PML_DOWNLOAD_URL . '?id=' . $processId . $strSession;
$oProcess = new Processes();
$oProcess->downloadFile( $downloadUrl, $localPath, $newfilename );
//getting the ProUid from the file recently downloaded
$oData = $oProcess->getProcessData( $localPath . $newfilename );
if (is_null( $oData )) {
$data['DOWNLOAD_URL'] = $downloadUrl;
$data['LOCAL_PATH'] = $localPath;
$data['NEW_FILENAME'] = $newfilename;
throw new Exception( G::loadTranslation( 'ID_ERROR_URL_PROCESS_INVALID', SYS_LANG, $data ) );
}
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD'] = $sProUid;
//if the process exists, we need to check the $importOption to and re-import if the user wants,
if ($oProcess->processExists( $sProUid )) {
//Update the current Process, overwriting all tasks and steps
if ($importOption == 1) {
$oProcess->updateProcessFromData( $oData, $localPath . $newfilename );
//delete the xmlform cache
if (file_exists( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid )) {
$oDirectory = dir( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid );
while ($sObjectName = $oDirectory->read()) {
if (($sObjectName != '.') && ($sObjectName != '..')) {
$strAux = PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP;
$strAux = $strAux . $sProUid . PATH_SEP . $sObjectName;
unlink( $strAux );
}
}
$oDirectory->close();
}
$sNewProUid = $sProUid;
}
//Disable current Process and create a new version of the Process
if ($importOption == 2) {
$oProcess->disablePreviousProcesses( $sProUid );
$sNewProUid = $oProcess->getUnusedProcessGUID();
$oProcess->setProcessGuid( $oData, $sNewProUid );
$oProcess->setProcessParent( $oData, $sProUid );
$oData->process['PRO_TITLE'] = "New - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
$oProcess->renewAll( $oData );
$oProcess->createProcessFromData( $oData, $localPath . $newfilename );
}
//Create a completely new Process without change the current Process
if ($importOption == 3) {
//krumo ($oData); die;
$sNewProUid = $oProcess->getUnusedProcessGUID();
$oProcess->setProcessGuid( $oData, $sNewProUid );
$strAux = "Copy of - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
$oData->process['PRO_TITLE'] = $strAux;
$oProcess->renewAll( $oData );
$oProcess->createProcessFromData( $oData, $localPath . $newfilename );
}
if ($importOption != 1 && $importOption != 2 && $importOption != 3) {
throw new Exception( G::loadTranslation( 'ID_PROCESS_ALREADY_IN_SYSTEM' ) );
}
}
//finally, creating the process if the process doesn't exist
if (! $oProcess->processExists( $processId )) {
$oProcess->createProcessFromData( $oData, $localPath . $newfilename );
}
//show the info after the imported process
$oProcess = new Processes();
$oProcess->ws_open_public();
$processData = $oProcess->ws_processGetData( $processId );
$result->status_code = 0;
$result->message = G::loadTranslation( 'ID_COMMAND_EXECUTED_SUCCESSFULLY' );
$result->timestamp = date( 'Y-m-d H:i:s' );
$result->processId = $processId;
$result->processTitle = $processData->title;
$result->category = (isset( $processData->category ) ? $processData->category : '');
$result->version = $processData->version;
return $result;
} catch (Exception $e) {
$result = new wsResponse( 100, $e->getMessage() );
return $result;
}
}
public function getCaseNotes ($applicationID, $userUid = '') public function getCaseNotes ($applicationID, $userUid = '')
{ {

View File

@@ -740,30 +740,7 @@
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="importProcessFromLibraryRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="sessionId" type="xs:string"/>
<xs:element name="processId" type="xs:string"/>
<xs:element name="version" minOccurs="0" type="xs:string"/>
<xs:element name="importOption" minOccurs="0" type="xs:string"/>
<xs:element name="usernameLibrary" minOccurs="0" type="xs:string"/>
<xs:element name="passwordLibrary" minOccurs="0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="importProcessFromLibraryResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="status_code" type="xs:integer"/>
<xs:element name="message" type="xs:string"/>
<xs:element name="processId" minOccurs="0" type="xs:string"/>
<xs:element name="processTitle" minOccurs="0" type="xs:string"/>
<xs:element name="category" minOccurs="0" type="xs:string"/>
<xs:element name="version" minOccurs="0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="getCaseNotesStruct"> <xs:complexType name="getCaseNotesStruct">
<xs:sequence> <xs:sequence>
<xs:element name="full_name" type="xs:string"/> <xs:element name="full_name" type="xs:string"/>
@@ -1085,12 +1062,6 @@
<message name="removeDocumentResponse"> <message name="removeDocumentResponse">
<part name="parameters" element="xs0:removeDocumentResponse"/> <part name="parameters" element="xs0:removeDocumentResponse"/>
</message> </message>
<message name="importProcessFromLibraryRequest">
<part name="parameters" element="xs0:importProcessFromLibraryRequest"/>
</message>
<message name="importProcessFromLibraryResponse">
<part name="parameters" element="xs0:importProcessFromLibraryResponse"/>
</message>
<message name="getCaseNotesRequest"> <message name="getCaseNotesRequest">
<part name="parameters" element="xs0:getCaseNotesRequest"/> <part name="parameters" element="xs0:getCaseNotesRequest"/>
</message> </message>
@@ -1264,10 +1235,6 @@
<input message="xs0:removeDocumentRequest"/> <input message="xs0:removeDocumentRequest"/>
<output message="xs0:removeDocumentResponse"/> <output message="xs0:removeDocumentResponse"/>
</operation> </operation>
<operation name="importProcessFromLibrary">
<input message="xs0:importProcessFromLibraryRequest"/>
<output message="xs0:importProcessFromLibraryResponse"/>
</operation>
<operation name="getCaseNotes"> <operation name="getCaseNotes">
<input message="xs0:getCaseNotesRequest"/> <input message="xs0:getCaseNotesRequest"/>
<output message="xs0:getCaseNotesResponse"/> <output message="xs0:getCaseNotesResponse"/>
@@ -1597,15 +1564,6 @@
<soap12:body use="literal"/> <soap12:body use="literal"/>
</output> </output>
</operation> </operation>
<operation name="importProcessFromLibrary">
<soap12:operation soapAction="urn:importProcessFromLibrary" soapActionRequired="true" style="document"/>
<input>
<soap12:body use="literal"/>
</input>
<output>
<soap12:body use="literal"/>
</output>
</operation>
<operation name="getCaseNotes"> <operation name="getCaseNotes">
<soap12:operation soapAction="urn:getCaseNotes" soapActionRequired="true" style="document"/> <soap12:operation soapAction="urn:getCaseNotes" soapActionRequired="true" style="document"/>
<input> <input>

View File

@@ -1026,20 +1026,6 @@ function systemInformation ($params)
return $res; return $res;
} }
function importProcessFromLibrary ($params)
{
$vsResult = isValidSession( $params->sessionId );
if ($vsResult->status_code !== 0) {
return $vsResult;
}
$ws = new wsBase();
$res = $ws->importProcessFromLibrary( $params->processId, $params->version, $params->importOption, $params->usernameLibrary, $params->passwordLibrary );
return $res;
}
function getCaseNotes ($params) function getCaseNotes ($params)
{ {
$vsResult = isValidSession( $params->sessionId ); $vsResult = isValidSession( $params->sessionId );
@@ -1258,7 +1244,6 @@ $server->addFunction("TaskList");
$server->addFunction("TaskCase"); $server->addFunction("TaskCase");
$server->addFunction("ReassignCase"); $server->addFunction("ReassignCase");
$server->addFunction("systemInformation"); $server->addFunction("systemInformation");
$server->addFunction("importProcessFromLibrary");
$server->addFunction("removeUserFromGroup"); $server->addFunction("removeUserFromGroup");
$server->addFunction("getCaseNotes"); $server->addFunction("getCaseNotes");
$server->addFunction("deleteCase"); $server->addFunction("deleteCase");

View File

@@ -103,7 +103,6 @@
$t->is( $methods[18] , 'taskCaseResponse taskCase(taskCaseRequest $parameters)' , 'taskCase'); $t->is( $methods[18] , 'taskCaseResponse taskCase(taskCaseRequest $parameters)' , 'taskCase');
$t->is( $methods[19] , 'systemInformationResponse systemInformation(systemInformationRequest $parameters)', 'systemInformation'); $t->is( $methods[19] , 'systemInformationResponse systemInformation(systemInformationRequest $parameters)', 'systemInformation');
$t->is( $methods[20] , 'triggerListResponse triggerList(triggerListRequest $parameters)' , 'triggerList'); $t->is( $methods[20] , 'triggerListResponse triggerList(triggerListRequest $parameters)' , 'triggerList');
$t->is( $methods[21] , 'importProcessFromLibraryResponse importProcessFromLibrary(importProcessFromLibraryRequest $parameters)' , 'importProcessFromLibraryRequest');
$t->diag('--------------- defined WSDL types --------------------' ); $t->diag('--------------- defined WSDL types --------------------' );
@@ -159,8 +158,6 @@
$type47 = "struct triggerListRequest {\n string sessionId;\n}"; $type47 = "struct triggerListRequest {\n string sessionId;\n}";
$type48 = "struct triggerListStruct {\n string guid;\n string name;\n string processId;\n}"; $type48 = "struct triggerListStruct {\n string guid;\n string name;\n string processId;\n}";
$type49 = "struct triggerListResponse {\n triggerListStruct triggers;\n}"; $type49 = "struct triggerListResponse {\n triggerListStruct triggers;\n}";
$type50 = "struct importProcessFromLibraryRequest {\n string sessionId;\n string processId;\n string version;\n string importOption;\n string usernameLibrary;\n string passwordLibrary;\n}";
$type51 = "struct importProcessFromLibraryResponse {\n integer status_code;\n string message;\n string processId;\n string processTitle;\n string category;\n string version;\n}";
$t->is( $types[0 ] , $type0 , 'login ' ); $t->is( $types[0 ] , $type0 , 'login ' );
$t->is( $types[1 ] , $type1 , 'loginResponse ' ); $t->is( $types[1 ] , $type1 , 'loginResponse ' );
@@ -256,17 +253,6 @@
if ( $foundProcess ) { if ( $foundProcess ) {
$t->is( $foundProcess, true, 'Sequential Process is present in this Workspace'); $t->is( $foundProcess, true, 'Sequential Process is present in this Workspace');
} }
else {
$res = ws_importProcessFromLibrary ( PROCESS_UID_LIBRARY , '' );
if ( $res->status_code == 0 ) {
$t->is( $res->status_code, 0, 'Process imported from Library successfully');
$t->diag( ' processTitle ' . $res->processTitle );
$t->diag( ' category ' . $res->category );
$t->diag( ' version ' . $res->version );
}
else
throw ( new Exception ( $res->message . ". Process '". PROCESS_UID ."' ") );
}
//checking the groupList //checking the groupList
$groups = ws_groupList() ; $groups = ws_groupList() ;
@@ -504,9 +490,3 @@
$res = ws_getCaseInfo ($caseId, $delIndex); $res = ws_getCaseInfo ($caseId, $delIndex);
$t->is( $res->status_code , 0 , 'ws_getCaseInfo status_code = 0'); $t->is( $res->status_code , 0 , 'ws_getCaseInfo status_code = 0');
$t->is( $res->caseStatus , 'COMPLETED' , 'ws_getCaseInfo caseStatus = ' . $res->caseStatus ); $t->is( $res->caseStatus , 'COMPLETED' , 'ws_getCaseInfo caseStatus = ' . $res->caseStatus );

View File

@@ -46,17 +46,6 @@
if ( $foundProcess ) { if ( $foundProcess ) {
$t->is( $foundProcess, true, 'Process for' .$uidName[1]. 'is present in this Workspace'); $t->is( $foundProcess, true, 'Process for' .$uidName[1]. 'is present in this Workspace');
} }
else {
$res = ws_importProcessFromLibrary ( $process_uid_library , '' , 3, PML_USER_ID, PML_USER_PASS );
if ( $res->status_code == 0 ) {
$t->is( $res->status_code, 0, 'Process imported from Library successfully');
$t->diag( ' processTitle ' . $res->processTitle );
$t->diag( ' category ' . $res->category );
$t->diag( ' version ' . $res->version );
}
else
throw ( new Exception ( $res->message . ". Process '". $uid_Process ."' ") );
}
} }
//creating an user, if this user exists just skip this lines //creating an user, if this user exists just skip this lines
@@ -343,4 +332,3 @@
$t->is( $foundUser2, true, 'user2 is present in Group employees'); $t->is( $foundUser2, true, 'user2 is present in Group employees');
$t->is( $foundUser3, true, 'user3 is present in Group finance'); $t->is( $foundUser3, true, 'user3 is present in Group finance');

View File

@@ -616,24 +616,6 @@ function ws_systemInformation() {
return $result; return $result;
} }
function ws_importProcessFromLibrary($processId, $version = '', $importOption = '', $usernameLibrary = '', $passwordLibrary = '') {
global $sessionId;
global $client;
$params = array (
'sessionId' => $sessionId,
'processId' => $processId,
'version' => $version,
'importOption' => $importOption,
'usernameLibrary' => $usernameLibrary,
'passwordLibrary' => $passwordLibrary
);
$result = $client->__SoapCall('importProcessFromLibrary', array (
$params
));
return $result;
}
function ws_InputDocumentList($caseId) { function ws_InputDocumentList($caseId) {
global $sessionId; global $sessionId;
global $client; global $client;