public void Execute() { int expectedArtifactID; //create field expectedArtifactID = ArtifactQueries.CreateFixedLengthTextField(WorkspaceArtifactId, SvcManager, CurrentUserIdentity); if (expectedArtifactID == 0) { throw new Exception("Field failed to create field"); } //fix //In a real scenario, workspace Artifact id would be coming in from a manager queue record. //Check to see if field exists /* const int newWorkspaceArtifactId = 1018783; * * _fieldArtifactId = ArtifactQueries.GetFieldArtifactId("Demo Document Field", AgentHelper.GetDBContext(newWorkspaceArtifactId)); * if (_fieldArtifactId == 0) * { * Console.WriteLine("Field is already present in the database :)"); * } * * expectedArtifactID = ArtifactQueries.CreateFixedLengthTextField(newWorkspaceArtifactId, SvcManager, CurrentUserIdentity);*/ }
public void Execute() { _fieldArtifactId = ArtifactQueries.CreateFixedLengthTextField(WorkspaceArtifactId, SvcManager, CurrentUserIdentity); if (_fieldArtifactId == 0) { throw new Exception($"Field failed to create field"); } #region //if (_fieldArtifactId == 0) //{ // throw new Exception($"Field failed to create field on workspace {WorkspaceArtifactId}"); //} #endregion #region ////In a real scenario, workspace Artifact id would be coming in from a manager queue record. //int newWorkspaceArtifactId = 1017097; ////Check to see if field exists //_fieldArtifactId = ArtifactQueries.GetFieldArtifactId("Demo Document Field", newWorkspaceArtifactId, SvcManager, CurrentUserIdentity); //if (_fieldArtifactId != 0) //{ // Console.WriteLine("Field is already present in the database :)"); //} //else //{ // // Create field // _fieldArtifactId = ArtifactQueries.CreateFixedLengthTextField(newWorkspaceArtifactId, SvcManager, CurrentUserIdentity); //} //if (_fieldArtifactId == 0) //{ // throw new Exception($"Field failed to create field"); //} #endregion }