Automatic Execution Commands
Previous Topic  Next Topic 

Automatic execution commands enables you to automatically run certain DMS commands from a third party application such as a timer application or a command batch file.  The automatic execution commands available are:

 

  1. Auto User Login via a user name to a specified database
  2. Auto Clear Selected Tables
  3. Auto Import Inventory
  4. Auto Import Jobs
  5. Auto SQL Import Jobs
  6. Auto Import Job Updates
  7. Auto SQL Update Jobs States
  8. Auto SQL Import Resources 
  9. Auto SQL Import Job Updates
  10. Auto Delete Jobs by Jobs State
  11. Auto Delete Assembly Structures by Job State
  12. Auto Delete BOM Links by Job State
  13. Auto Schedule Run
  14. Auto Report
  15. Auto Logout

 

Any parameter that has a space in the command line must be surrounded in quotation marks.  It is suggested that all commands be surrounded in quotation marks as a standard. The name of the executable for DMS is DMSEnt.EXE and the format for a command is as follows:


"C:\Dynafact\Production\DMS\DMSEnt.exe" "UserIniFolder=C:\Dynafact\Production\DMS\User\" "AutoCommand1=parameter1" "AutoCommand2=parameter2” …


Note that the folder location of the DMSEnt.EXE is given as well as the user initialization file location as in UserIniFolder=C:\Dynafact\Production\DMS\User\.  The user initialization file location is required so that DMS knows where to find the DMS data and SQL Server.


The order of the commands and their parameters on the command line does not impact the order of the commands executed.  That is, if more than one command has been given DMS will always execute the commands in the following order:


  1. Log in to the given database
  2. Import inventory
  3. Import jobs
  4. Import job updates
  5. Run a schedule
  6. log out


In order to execute an auto command, the auto user specified on the command line must have privileges to those commands in their user group.


When DMS executes an automatic command the command being executed appears on the screen so that an observer can see the progress of the command being executed. Errors that cannot be written to a file (such as invalid command filename has been given) will be displayed on the screen waiting for a user response.


You can run two different auto commands together enabling you to import jobs and then immediately run a schedule after the import.  DMS always runs the import jobs before running a schedule regardless of the order the automatic execution parameters given in the command line.


The following example command line logs in the user Jim Smith to the database DMSData, imports jobs using the command file C:\Program Files\Dynafact\ImportCmd.TXT after which a schedule will run using the schedule command file in C:\Program Files\Dynafact\SchdCmd.TXT, and once completed, the system will log the user out:


"C:\Dynafact\Production\DMS\DMSEnt.exe" "UserIniFolder=C:\Dynafact\Production\DMS\User\" “AutoUserName=Jim Smith” DataBaseName=DMSData “AutoImportJobs=C:\Program Files\Dynafact\ImportCmd.TXT" “AutoScheduleRun=C:\Program Files\Dynafact\SchdCmd.TXT" AutoLogOut


Note that if you want to run a command more than once, you must specify an entirely new command line.  For example, if you want to run more than one SQL import, each SQL import must be a separate command.  As an example, the following will clear selected job tables, run three SQL import commands, and then run a schedule:


"C:\Dynafact\Production\DMS\DMSEnt.exe" "UserIniFolder=C:\Dynafact\Production\DMS\User\" "AutoUserName=DMS" " DataBaseName=DMSCopy" "ClearSelectedTables" "AutoLogOut"

"C:\Dynafact\Production\DMS\DMSEnt.exe" "UserIniFolder=C:\Dynafact\Production\DMS\User\" "AutoUserName=DMS" " DataBaseName=DMSCopy" "AutoSQLImportJobs=C:\Program Files\Dynafact\DMS\ImportCmd1.TXT" "AutoLogOut"

"C:\Dynafact\Production\DMS\DMSEnt.exe" "UserIniFolder=C:\Dynafact\Production\DMS\User\" "AutoUserName=DMS" " DataBaseName=DMSCopy" "AutoSQLImportJobs=C:\Program Files\Dynafact\DMS\ImportCmd2.TXT" "AutoLogOut"

"C:\Dynafact\Production\DMS\DMSEnt.exe" "UserIniFolder=C:\Dynafact\Production\DMS\User\" "AutoUserName=DMS" " DataBaseName=DMSCopy" "AutoSQLImportJobs=C:\Program Files\Dynafact\DMS\ImportCmd3.TXT" "AutoLogOut"

"C:\Dynafact\Production\DMS\DMSEnt.exe" "UserIniFolder=C:\Dynafact\Production\DMS\User\" "AutoUserName=DMS" " DataBaseName=DMSCopy" "AutoScheduleRun=C:\Program Files\Dynafact\DMS\ScheduleCmd.TXT" "AutoLogOut"


Specifying each command on a separate line in the batch file makes it easier to read and edit in the future.