Component and Variable Immutability

Component call Write Event

  • accept the EVTNAME, EVTMSG, and BATID as params
  • It will then write this out to a log sql log table specifically for this application

The component will

  • pass through the DB Connection node

    • so that multiple write events can be daisy-chained together
    • this will simplify the number of connectors on a WF
  • Clear all input variables and only output BATGUID

Workflow

  • The below sample has been built to isolate the problem and does not represent an actual business workflow
    • This shows a first and second call to the write event component
    • Between calls, the variable values get updated
    • The db connector gets daisy chained to the second instance

The Issue

  • The component will not “forget” previous execution variable values between the first and second execution
    • On the second execution, it will use the values from the first execution

First Execution

  • variables are initially created
  • those variables are passed to the Write Event component via the dialogue setup within the component
  • this runs as expected

Second Execution

  • The variable expressions are assigned new values|

    • The output from this is correct
  • These variables are then passed to the Write Event component in the same way as run #1

    • the variables sMsg1 and var1 have new values
    • these variables get passed to the component in the same way as run#1
      image
  • within the Write Event component

    • the variable values passed to the string configuration dialogue are still using the run #1 values

Theory On Issue

  • this seems to be coming from daisy chaining the db connecter output
  • if the second write event component gets its connection from the SQL Server connector node, as shown here; it works
  • My question is why?
    • why can the variable expression not be updated
    • it appears that the run#1 values are coming in with the DB Connector
  • Am I just not understanding the lifecycle of a variable?

Hello @nbt1032b,

Thank you for your question.

I suspect that your DB SQL Executor node might be passing along some flow variables that could be causing duplicates in the subsequent component. Could you try using the Variable Filter node to identify and filter them out? Mae sure to keep any unknown values in the exclude list if they are not required. This might help resolve the issue.

Best,
Keerthan

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.