Lawson IPA Javascript Arrays

Sort:
You are not authorized to post a reply.
Author
Messages
Kert490
Basic Member
Posts: 14
Basic Member

    I am developing a IPA workflow to import data from a spreadsheet and then create Lawson Transactions from each record in the spreadsheet.  I am using a double dimension array in javascript to store the lines and columns from the spreadsheet before I validate and then import the data with Lawson Transaction nodes.

     

    When I run the process on the development server, it runs fine and the Transaction nodes insert the data in the database with no errors.  When I deploy to the development server it appears that the arrays don't have any data in them and then the transactions fail since data is missing.  This is using the same file on the same database in both these situations.  The only difference is that the developer tool is on a different machine that the dev deployment environment.

     

    I'm wondering if there is some sort of bug with this, but I haven't found anything yet.  Does anyone have experience deploying arrays or double dimension arrays in Lawson Workflow?  Has this ever happened to you.

    I am also wondering if our development environment was not setup correctly and that is why the arrays fail there but not in the developer tool.  I really don't know what to look for if this is the case.

    Any insight into these situations would be helpful.

     

     

     

    John Henley
    Senior Member
    Posts: 3348
    Senior Member
      Are you using any custom-built JavaScript functions in the IPA flow?
      If so, make sure the custom (pflow_user.js file) is deployed to your dev/test server.
      Also, make sure you have logging enabled on the flow while you are testing it, and check the workunit log in IPA for errors.
      Thanks for using the LawsonGuru.com forums!
      John
      David Williams
      Veteran Member
      Posts: 1127
      Veteran Member
        I recently played with double dimensions in IPA; although true ones don’t exist in JavaScript, you can make them work. Are you building and processing your JavaScript functions within the flow or, like John asked, within the plow.js file on your desktop?
        David Williams
        Kert490
        Basic Member
        Posts: 14
        Basic Member

          I did some additional testing to try to find out what the issue is with the arrays losing their data.  What I found was that data set before my User action was fine and I could access it without issue.  After the user action all my data vanishes.  Apparently, when I deploy the Process to the Development server, a UserAction causes the data to not persist.

           

          The current User Action is an approval of the transactions being entered and is the point of the process, so it can't be removed.  It kind of makes sense that it might have problems persisting data after the user action, because the process has to stop and wait an undetermined amount of time.  Apparently when it starts back up it loses the values of most variables.

           

          Any clue how to get around this or why this would happen?  This seems to be a very large bug to not notice.

           

           

          Bob Canham
          Veteran Member
          Posts: 217
          Veteran Member
            That's actually the expected behavior (unfortunately). Only start node variables persist an interruption by a user action node. If you want to keep it, you either need to store it in a start node variable, or write it somewhere that you can read back in when the flow restarts.
            Kyle Jorgensen
            Veteran Member
            Posts: 122
            Veteran Member
              Bob Canham is spot-on. Non-persistent variables are lost after a User Action. Define the array variable in the start node and it should persist until after the User Action.

              There is a caveat to this; Start Node variables are stored in the Landmark database table named PFIWORKUNITVARIABLE. The value of the variable is in a column named VARIABLEVALUE and that column is defined as "nvarchar(2048)".

              So if your array is more than a little bit large....you'll still lose data.
              We've run into this problem with "String" Start Node variables.
              Unfortunately, I haven't found a succinct work-around for it.
              Kyle Jorgensen
              Veteran Member
              Posts: 122
              Veteran Member
                Correction, the table is PFIACTIVITYVARIABLE. However the column name and size is the same.
                Kert490
                Basic Member
                Posts: 14
                Basic Member

                  I've been doing some more research and I was seeing the same explanations in other Forums.  Since I can't guarantee that the data in my file will be less than 2048 bytes,  I believe I will need to read from the file again.

                   

                  One question occurred to me.  How does Lawson retain the data in the input file if it is over 2048 bytes.  Will this cause other issues?

                   

                   

                  You are not authorized to post a reply.