diff --git a/Autodesk.VltInvSrv.iLogicSampleJob/Properties/AssemblyInfo.cs b/Autodesk.VltInvSrv.iLogicSampleJob/Properties/AssemblyInfo.cs index 9c4aba0..47796cd 100644 --- a/Autodesk.VltInvSrv.iLogicSampleJob/Properties/AssemblyInfo.cs +++ b/Autodesk.VltInvSrv.iLogicSampleJob/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2021.0.2.1")] -[assembly: AssemblyFileVersion("2021.0.2.1")] +[assembly: AssemblyVersion("2021.0.3.0")] +[assembly: AssemblyFileVersion("2021.0.3.0")] diff --git a/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobAdminForm.Designer.cs b/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobAdminForm.Designer.cs index 803d5b4..360715f 100644 --- a/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobAdminForm.Designer.cs +++ b/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobAdminForm.Designer.cs @@ -158,9 +158,11 @@ private void InitializeComponent() this.lblDebugInfo.AutoSize = true; this.lblDebugInfo.Location = new System.Drawing.Point(163, 20); this.lblDebugInfo.Name = "lblDebugInfo"; - this.lblDebugInfo.Size = new System.Drawing.Size(310, 52); + this.lblDebugInfo.Size = new System.Drawing.Size(368, 39); this.lblDebugInfo.TabIndex = 2; - this.lblDebugInfo.Text = resources.GetString("lblDebugInfo.Text"); + this.lblDebugInfo.Text = "Advanced Rule Debugging stops the Job execution with a Message Box.\r\nUse Visual S" + + "tudio and attach to the process \'VaultInventorServer.exe\' before\r\nconfirming the" + + " message with OK."; this.lblDebugInfo.Click += new System.EventHandler(this.lblDebugInfo_Click); // // chckBoxBreak diff --git a/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobAdminForm.resx b/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobAdminForm.resx index 641c28c..6e783d1 100644 --- a/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobAdminForm.resx +++ b/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobAdminForm.resx @@ -117,12 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Enabling extended debugging expects the environment variable -"iLogicRuleFolderForVS" and an available path's value. -The installer added the path C:\WINDOWS\TEMP. -Check that you have access to the location. - 336, 14 diff --git a/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobExtension.cs b/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobExtension.cs index 2860d2f..219445f 100644 --- a/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobExtension.cs +++ b/Autodesk.VltInvSrv.iLogicSampleJob/iLogicJobExtension.cs @@ -32,6 +32,7 @@ public class iLogicJobExtension : IJobHandler private Int32 mRuleSuccess = -1; private List mAllRules = new List(); private string mAllRulesTextWrp = ""; + private string mRuleTmp = "\\iLogicVaultJobRules"; #region IJobHandler Implementation public bool CanProcess(string jobType) @@ -44,8 +45,6 @@ public JobOutcome Execute(IJobProcessorServices context, IJob job) try { - Inventor.InventorServer mInv = context.InventorObject as InventorServer; - #region validate execution rules //pick up this job's context @@ -144,6 +143,28 @@ public JobOutcome Execute(IJobProcessorServices context, IJob job) } } + //enable advanced debug break + if (mSettings.ActivateDebugBreak == "True") + { + try + { + System.IO.DirectoryInfo mRuleTempInfo = new System.IO.DirectoryInfo(System.IO.Path.GetTempPath() + mRuleTmp); + if (mRuleTempInfo.Exists == false) + { + mRuleTempInfo = System.IO.Directory.CreateDirectory(System.IO.Path.GetTempPath() + mRuleTmp); + } + System.Environment.SetEnvironmentVariable("iLogicRuleFolderForVS", mRuleTempInfo.FullName); + } + catch (Exception e) + { + { + context.Log(null, "Advanced Debug Break tried to create a temporary system variable but failed with the error: " + e.Message); + return JobOutcome.Failure; + } + } + } + + Inventor.InventorServer mInv = context.InventorObject as InventorServer; ApplicationAddIns mInvSrvAddIns = mInv.ApplicationAddIns; ApplicationAddIn iLogicAddIn = mInvSrvAddIns.ItemById["{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}"]; @@ -352,16 +373,24 @@ public JobOutcome Execute(IJobProcessorServices context, IJob job) string mILogicLogFileFullName = ""; if (mLogCtrl.Level != 0) { - string mLogName = job.Id + "_" + mFile.Name + "_iLogicSampleJob.log"; - System.IO.DirectoryInfo mLogDirInfo = new System.IO.DirectoryInfo(mSettings.iLogicLogDir); - if (mLogDirInfo.Exists == false) + //validate that a log path is configured and exists + if (mSettings.iLogicLogDir != "") + { + string mLogName = job.Id + "_" + mFile.Name + "_iLogicSampleJob.log"; + System.IO.DirectoryInfo mLogDirInfo = new System.IO.DirectoryInfo(mSettings.iLogicLogDir); + if (mLogDirInfo.Exists == false) + { + mLogDirInfo = System.IO.Directory.CreateDirectory(mSettings.iLogicLogDir); + } + mILogicLogFileFullName = System.IO.Path.Combine(mLogDirInfo.FullName, mLogName); + } + else { - mLogDirInfo = System.IO.Directory.CreateDirectory(mSettings.iLogicLogDir); + context.Log(null, "The configured log level requires a path and exited because no valid path exists. Review and correct the JobExtension's iLogic Configuration."); + return JobOutcome.Failure; } - mILogicLogFileFullName = System.IO.Path.Combine(mLogDirInfo.FullName, mLogName); } - //read rule execution settings string mExtRule = null; string mExtRuleFullLocalName = null; @@ -615,6 +644,17 @@ public JobOutcome Execute(IJobProcessorServices context, IJob job) mInvDfltProject.Activate(); //delete temporary working folder if imlemented here + //delete the temporary rule debug variable and related folder + if (System.Environment.GetEnvironmentVariable("iLogicRuleFolderForVS") != null) + { + System.IO.DirectoryInfo mRuleTempInfo = new System.IO.DirectoryInfo(System.Environment.GetEnvironmentVariable("iLogicRuleFolderForVS")); + if (mRuleTempInfo.Exists) + { + System.IO.Directory.Delete(mRuleTempInfo.FullName, true); + } + System.Environment.SetEnvironmentVariable("iLogicRuleFolderForVS", null); + } + #endregion reset return JobOutcome.Success; diff --git a/README.md b/README.md index 1c3c322..c31b0f7 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ relationship are not supported. VERSION HISTORY / RELEASE NOTES: --------------------------------- +2021.0.3.0 - Resolved logging and advanced debugging issues; see project '2021.0.3 Update' for details. 2021.0.2.1 - All dialogs are user resizeable; fixed several issues, see commits for details 2021.0.1.4 - Job Administration Dialog, new Options tab 2021.0.1.0 - Renamed tabs in iLogic Job Administration Dialog, Added MSI Installer Project diff --git a/Setup1/Setup1.vdproj b/Setup1/Setup1.vdproj index e2f1afe..3520ee4 100644 --- a/Setup1/Setup1.vdproj +++ b/Setup1/Setup1.vdproj @@ -1961,15 +1961,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Autodesk Vault iLogicJobExtension SampleApp 2021" - "ProductCode" = "8:{8FF10DFD-194A-4F36-956A-BEF6277B8BF5}" - "PackageCode" = "8:{B7BF8810-88E1-4D40-A8AA-7485AB560A24}" + "ProductCode" = "8:{57A08A24-AE2D-4873-B398-5DA5C231ECD5}" + "PackageCode" = "8:{05B1344A-E12C-47C9-82D4-02AE50B731F3}" "UpgradeCode" = "8:{99F32B73-324F-4D8B-B249-BC735D036446}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" - "ProductVersion" = "8:2.1.2021" + "ProductVersion" = "8:3.0.2021" "Manufacturer" = "8:Autodesk" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:https://github.com/koechlm/Vault-Job-Processor---iLogic-Extension/issues" @@ -1994,84 +1994,6 @@ { "Keys" { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_B11564E660AF44869F0316BBCD8E117E" - { - "Name" = "8:SYSTEM" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_202F70A3EFB54F2FBD4EB33A01F2C98B" - { - "Name" = "8:CurrentControlSet" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_85E40A12293D4F4B80AA2CEBE699DA97" - { - "Name" = "8:Control" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_BA932380B57C4A87AEA2D695C014C5EC" - { - "Name" = "8:Session Manager" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_5DB898208A3343F684CAAD267FFED2A6" - { - "Name" = "8:Environment" - "Condition" = "8:" - "AlwaysCreate" = "11:TRUE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - "{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_DBC79008F7964EBA9855236B1640B8D4" - { - "Name" = "8:iLogicRuleFolderForVS" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "ValueTypes" = "3:1" - "Value" = "8:C:\\WINDOWS\\TEMP" - } - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } - } - "Values" - { - } - } } } "HKCU" @@ -2505,7 +2427,7 @@ { "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_839FAA723C0A4CDDBE6F856FA92F8E74" { - "SourcePath" = "8:" + "SourcePath" = "8:..\\Autodesk.VltInvSrv.iLogicSampleJob\\obj\\x64\\Debug\\Autodesk.VltInvSrv.iLogicSampleJob.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_82DFAA786EAF42B8B444014ADD0F8A21"