I need some SysCommand help please...

 18 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
TBonney
Veteran Member
Posts: 281
Veteran Member
    Can anyone provide insight on how to get the syscommand node to operate properly?

    I was unable to get a transaction node to update job parameters for a web run node to call a Lawson job. So, it was suggested that I try writing a batch to update the job parameters and use a syscommand node to run the batch instead (still followed by web run to execute the newly updated job).

    However, I now can't get the syscommand node to work either. Please Help!!!

    I am using run cmd.exe execution mode (Windows) to try to run the batch file. However, it does not matter what syntax I use, nor which directory I place the file in and point to, I continue to get the following error: "Command output (combined): The system cannot find the path specified."

    Can anyone advise how to successfully get the syscommand node to run a btach file?

    Thank you!
    John Henley
    Posts: 3353
      Which Windows version? MKS or LUU?=
      Thanks for using the LawsonGuru.com forums!
      John
      TBonney
      Veteran Member
      Posts: 281
      Veteran Member
        Thank you for your reply John.

        We're on Windows 2003 R2, Enterprise Edition, Service Pack 1.

        I think we still use MKS...we're on 9.0.0.7 environment and 9.0/MSP5 applications...
        Shane Jones
        Veteran Member
        Posts: 460
        Veteran Member
          We are doing the same thing and having the same issues... I get errors that the flow could not find the specified path. I have opened a command window and the command runs fine from there. I am using a "Mapped" drive within the flow. Originally, I did not map the drive and tried a UNC path. The path is rather simple so I am not sure why Processflow is having issues with the drive: (H:\FTPRoot\TFiles\tfile.txt)

          Anyone have thoughts?
          Shane Jones
          Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
          Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
          ** Teach others to fish...
          Shane Jones
          Veteran Member
          Posts: 460
          Veteran Member
            Here is some additional information from running the flow... Thought it might help explain the error. I am hoping someone has seen this before. I think it is interesting that it is duplicating the "\"

            My log file shows this: (error)

            Command output (combined): gpg: can't open `H:\\FTPRoot\\TFiles\\tfile.txt': No such file or directory
            gpg: decrypt_message failed: No such file or directory

            However, the command has this:

            H:\FTPRoot\TFiles\tfile.txt
            Shane Jones
            Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
            Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
            ** Teach others to fish...
            David Williams
            Veteran Member
            Posts: 1127
            Veteran Member
              TBonney - to your original point, you can't get the job parameters to update or you can't kick off the job.
              David Williams
              John Henley
              Posts: 3353
                Remember that mapped drives don't exist for all users, and when the flow is running on the server (and depending on which command type you are using), so the mapped drive might not exist.

                Did the UNC path work? =
                Thanks for using the LawsonGuru.com forums!
                John
                TBonney
                Veteran Member
                Posts: 281
                Veteran Member
                  Thanks for the replies guys!

                  To clarify, I am updating the job parameters by calling a batch with a syscmd node now because I could not get the flow to update the parameters using a transaction node. At this point, I am unable to update the job parameters at the syscmd node, so it is failing before even getting to the job submission transaction node.

                  As far as the mapped drives point goes, I tried moving the batch file to several different locations, mapped and local, and couldn't get it to work regardless of where I was poiniting to to find the batch file.

                  Thank you!
                  TBonney
                  Veteran Member
                  Posts: 281
                  Veteran Member
                    My batch job has been moved to the D: drive (no mapped drive), but it still doesn't work.

                    Here is what I have written in my SysCmd node:
                    Execution Mode = run cmd.exe(Windows only)
                    Execution Syntax = cmd.exe /C {command} **By default, not defined by me**
                    Command: "D: && cd cladmin\scripts\nds\bn106_updates\ && BN106_ParmsUpdate.bat"

                    Any assistance or direction anyone can provide would be greatly appreciated!! Thanks.
                    Shane Jones
                    Veteran Member
                    Posts: 460
                    Veteran Member
                      We got something to work but it was strange - we had to create a vbs script saved in the bpm directory to get it to work ... (windows server)
                      Shane Jones
                      Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
                      Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
                      ** Teach others to fish...
                      TBonney
                      Veteran Member
                      Posts: 281
                      Veteran Member
                        Thank you Shane!

                        It seems kind of counterproductive for Lawson to provide these "power tool" nodes within PFI and then limit their performance by only allowing them to work properly if utilized from the bpm directory.

                        Does anyone else have any similar experience to Shane's or have any additional input on this topic?

                        Thank you.
                        Shane Jones
                        Veteran Member
                        Posts: 460
                        Veteran Member
                          TBonney, I was disappointed that the script has to be saved as a file instead of adding it into the node directly. I was less concerned about interacting with another server (However, I do have this working now as well). My problem is that the script needs coded values that are determined during the flow. The only way I could handle this since I could not put the script directly in the PF Node was to have the flow create a file on the fly and then later in the flow run the file that was created. Because of the speed of the flow I had to enter a pause within the flow so that it would wait for a few seconds before proceeding so that I could make sure that the file that the flow created had been saved and was available for use.

                          I have asked Lawson a couple times to have an integration node added to processflow for encrypting files and enteracting with FTP servers. (If this would be helpful for any of you please add it to the enhancement requests.)
                          Shane Jones
                          Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
                          Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
                          ** Teach others to fish...
                          TBonney
                          Veteran Member
                          Posts: 281
                          Veteran Member
                            The only way that I could get it to "work", was to move the related batch file into the LINTE\gen\bpm\ directory and run it from there. So, now the flow successfully makes it to the SysCmd node...HOWEVER, now it times out before completing the process!

                            This was supossed to be a simple flow to update the parameters of and then submit a batch job. But, that was 3 months ago... And now, Lawson can't even help me to get the stupid thing to work. I've had a case open with them for almost three weeks now and I'm getting nowhere with it. I'm so glad we spent 40K to purchase Proces Flow Integrator!

                            Has any one else had such difficulty achieving such a simple goal/task with PFI? I don't understand why this is such a joke.

                            Thank you.
                            David Williams
                            Veteran Member
                            Posts: 1127
                            Veteran Member
                              What job are you trying to update and run? Why couldn't you update the job with an AGS call?
                              David Williams
                              John Henley
                              Posts: 3353
                                I have used the AGS/Transaction node to add the job, and the webrun node to run it
                                On newer LSF9/Windows combinations the webrun node w/ jobrun.exe requires very specific parameters to work correctly.
                                And, when using the Designer, and 'run on server' option, it does timeout on the webrun node, but it does work :)

                                Thanks for using the LawsonGuru.com forums!
                                John
                                TBonney
                                Veteran Member
                                Posts: 281
                                Veteran Member
                                  DavidW,
                                  Thanks for your reply. It is a BN106 job whose parameters I am trying to update. When I initially created the flow, I tried to use a Transaction node to update the job, but that didn't work either. I couldn't figure out why, but it was successfully submitting the job, but the parameters were not getting updated prior to submission. As a result, the job output was inaccurate.

                                  At that point, I had another consultant recommend that I update the job with a bacth program and call that from a SysCmd node. So, I wrote the batch program, (successfully) tested it and then proceeded to try and call it from the process flow using the SysCmd node, which led me to where I am today.

                                  John,
                                  Thanks for your reply as well. As you can see from my reply to DavidW, I had originally tried your suggested approach, using combination of Transaction to uopdate and WebRun to submit the jobs. However, this too was unsuccessful. The BN106 job(s) in question already exist, but the parameters need to be updated each week, prior to submission.

                                  So, now that I have the SysCmd node at least finding and initiating the batch file in question, is there any way to avoid the time out in designer (run on server) so that I can validate that the flow proceeds on to the WebRun node for job submission?

                                  Presently, my alternative/workaround to this entire process flow is that I have a Winows scheduled task set up to run the batch program to update the BN106 parameters, followed by a series of Lawson recdefs (one for each distinct BN106) submitting the batch jobs.

                                  Should I just leave well enough alone and bail on the whole idea of trying to do this all thorugh a process flow instead of a series of Windows scheduled tasks & Lawson recdefs?

                                  Thank you.
                                  Shane Jones
                                  Veteran Member
                                  Posts: 460
                                  Veteran Member
                                    Tbonney,
                                    What was happening when you tried to modify BN106 with a standard AGS? Processflow is quite robust so I am wondering what you are trying to change. Are you trying to change the "jobdef" or are you changing information on the form directly? I just created a quick flow that modifies an existing BN106 job in Processflow ...

                                    Your statement about getting the job to submit with old data tells me that you might need to enter a pause in your process so that the job gets updated completely with the AGS before you submit the job with the WEBRUN. (This is possible but kludgey - create a variable (Integer) and then set it to be 0. Use a branch between the AGS and WEBRUN - Have the branch go to an assign if the integer is LESS THAN some number (like 20) and then when it goes to the assign add 1 to the variable and return to the branch. If the variable is = to the limit go to the WEBRUN.)

                                    Here are two AGS that might help?

                                    Changed a BN106
                                    _PDL=PRODUCTLINE&_TKN=BN106&_EVT=CHG&_RTN=DATA&_LFN=ALL&_TDS=IGNORE&FC=C&JOB-NAME=BN106TST&USER-NAME=DOMAIN\user&FILE-EFF-DATE=20110621&EMP-RES-ADD=0&COMPANY=1&FILE-OPTION=1&INS-CARRIER=DN04&PLAN-TYPE=DN&PLAN-CODE1=DN04&_DELIM=%09&_OUT=XML&_EOT=TRUE

                                    Added a BN106
                                    _PDL=PRODUCTLINE&_TKN=BN106&_EVT=ADD&_RTN=DATA&_LFN=ALL&_TDS=IGNORE&FC=A&JOB-NAME=BN106TS2&USER-NAME=DOMAIN\user&FILE-EFF-DATE=20110622&EMP-RES-ADD=1&COMPANY=1&FILE-OPTION=1&INS-CARRIER=DN04&PLAN-TYPE=DN&PLAN-CODE1=DN04&_DELIM=%09&_OUT=XML&_EOT=TRUE

                                    Tbonney - I created a flow that appears to work with a short pause in the flow....   (shanesmj@yahoo.com)
                                    Shane Jones
                                    Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
                                    Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
                                    ** Teach others to fish...
                                    TBonney
                                    Veteran Member
                                    Posts: 281
                                    Veteran Member
                                      Shane,

                                      Thank you. I've gotten this flow working in test now, updating the parameters via a batch job (which does a SQL update to the paramter values) and then goes on to subsequent a separate webrun node for each job to submit the jobs. However, I was only able to do this after having moved the batch file into the \bpm\ directory. I don't understand why Lawson/Process Flow is unable to recognize the presence of such a file from any opther directory?

                                      Thanks.
                                      Shane Jones
                                      Veteran Member
                                      Posts: 460
                                      Veteran Member
                                        Good to hear that it is working for you.... I was able to find a way to get our system commands to work as well. I think our system commands had issues because of mapped drives or UNC paths and I just found that it was easier to create a vbs to call with the system command.
                                        Shane Jones
                                        Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
                                        Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
                                        ** Teach others to fish...