IntegrationIntegrateProjectData Method |
Run the integration for loading project data.
Namespace:
Cobra.WebService.ClientAPI.Application.Files
Assembly:
Cobra.WebService.ClientAPI (in Cobra.WebService.ClientAPI.dll) Version: 8.4.717.3176 (8.4.0717.3176)
Syntax public ServiceResult IntegrateProjectData(
IntegrateProjectDataServiceArguments integrateProjectDataServiceArguments
)
Parameters
- integrateProjectDataServiceArguments
- Type: Cobra.Model.WebServiceIntegrateProjectDataServiceArguments
An instance of IntegrateProjectDataServiceArguments class that contains the options to run the integration for loading project data.
Return Value
Type:
ServiceResultThe result of running the integration for loading project data.
Exceptions Exception | Condition |
---|
InvalidOperationException | Thrown when state of the instance of the CobraServices that generated the current Integration is not in opened state. |
Examples
This sample shows how to run the integration for loading project data.
using Cobra.Model.WebService;
using Cobra.WebService.ClientAPI;
using Cobra.WebService.ClientAPI.Client;
using Cobra.WebService.ClientAPI.Application.Files;
.
.
.
CobraServices cobraServices = new CobraServices();
cobraServices.ServiceIdentityData.Username = "SYSADMIN";
cobraServices.ServiceIdentityData.SecurePassword = new SecurePassword();
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('P');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('A');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('W');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('O');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('R');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('D');
cobraServices.ServiceIdentityData.DataSourceKey = "COBRA";
LoginResult loginResult = cobraServices.Login();
if (!loginResult.Success) {
Console.WriteLine("Login failed.");
return;
}
Console.WriteLine("Login Success.");
Integration integration = cobraServices.CreateServiceOperations<Integration>();
IntegrateProjectDataServiceArguments integrateProjectDataServiceArguments = integration.CreateIntegrationServiceArguments<IntegrateProjectDataServiceArguments>();
integrateProjectDataServiceArguments.ConfigurationName = "MyConfig";
integrateProjectDataServiceArguments.ConfigurationOwner = "SYSADMIN"
integrateProjectDataServiceArguments.ProcessesToRun = Processes.UpdateTotals | Processes.Respread;
integrateProjectDataServiceArguments.Filter.Criteria = "Work Package";
integrateProjectDataServiceArguments.Filter.DeleteSelectionCriteriaItemsOnly = true;
integrateProjectDataServiceArguments.Filter.Selection = new string[2] { "1.3.1 / 1220 / 01", "1.3.1 / 1220 / 02" };
Console.WriteLine("Running Integration for loading project data...");
ServiceResult integrateProjectDataResult = integration.IntegrateProjectData(integrateProjectDataServiceArguments);
if (integrateProjectDataResult.Success)
Console.WriteLine("Integration process completed successfully.");
else
Console.WriteLine("Integration process did not completed successfully
cobraServices.LogOut();
See Also