public override RepositoryItem GetUpdatedRepoItem(RepositoryItem itemToUpload, RepositoryItem existingRepoItem, string itemPartToUpdate) { Activity updatedActivity = null; //update required part eItemParts ePartToUpdate = (eItemParts)Enum.Parse(typeof(Activity.eItemParts), itemPartToUpdate); switch (ePartToUpdate) { case eItemParts.All: case eItemParts.Details: updatedActivity = (Activity)itemToUpload.CreateCopy(false); if (ePartToUpdate == eItemParts.Details) { updatedActivity.Acts = ((Activity)existingRepoItem).Acts; updatedActivity.Variables = ((Activity)existingRepoItem).Variables; } break; case eItemParts.Actions: updatedActivity = (Activity)existingRepoItem.CreateCopy(false); updatedActivity.Acts = ((Activity)itemToUpload).Acts; break; case eItemParts.Variables: updatedActivity = (Activity)existingRepoItem.CreateCopy(false); updatedActivity.Variables = ((Activity)itemToUpload).Variables; break; } return(updatedActivity); }
public virtual RepositoryItem GetUpdatedRepoItem(RepositoryItem selectedItem, RepositoryItem existingItem, string itemPartToUpdate) { throw new Exception("GetUpdatedRepoItem() was not implemented for this Item type"); }
public override void UpdateInstance(RepositoryItem instance, string partToUpdate, RepositoryItem hostItem = null) { Activity activityInstance = (Activity)instance; //Create new instance of source Activity newInstance = (Activity)this.CreateInstance(); newInstance.IsSharedRepositoryInstance = true; //update required part Activity.eItemParts ePartToUpdate = (Activity.eItemParts)Enum.Parse(typeof(Activity.eItemParts), partToUpdate); switch (ePartToUpdate) { case eItemParts.All: case eItemParts.Details: newInstance.Guid = activityInstance.Guid; newInstance.ParentGuid = activityInstance.ParentGuid; newInstance.ExternalID = activityInstance.ExternalID; newInstance.ActivitiesGroupID = activityInstance.ActivitiesGroupID; newInstance.TargetApplication = activityInstance.TargetApplication; newInstance.Active = activityInstance.Active; if (ePartToUpdate == eItemParts.Details) { //keep other parts newInstance.Acts = activityInstance.Acts; newInstance.Variables = activityInstance.Variables; } if (instance.ExternalID == this.ExternalID) { AddExistingSelectionListVariabelesValues(newInstance, activityInstance); //increase selection list vars values- needed for GingerATS integration so based on External ID } if (hostItem != null) { //replace old instance object with new int originalIndex = ((BusinessFlow)hostItem).Activities.IndexOf(activityInstance); ((BusinessFlow)hostItem).Activities.Remove(activityInstance); ((BusinessFlow)hostItem).Activities.Insert(originalIndex, newInstance); } break; case eItemParts.Actions: activityInstance.Acts = newInstance.Acts; break; case eItemParts.Variables: activityInstance.Variables = newInstance.Variables; break; } }
/// <summary> /// Been used for updating the Shared Reporsitiry item instance /// </summary> public virtual void UpdateInstance(RepositoryItem instanceItem, string itemPartToUpdate, RepositoryItem hostItem = null) { throw new Exception("UpdateInstance() was not implemented for this Item type"); }