Loading data into form from another Entity

Scenario

  1. User wants to create Test Protocol of engine.
  2. User measures engine on the network analyzer which saves values to dbase file. User can do several different measurements.
  3. User wants to put the measured values from analyzer into Test Protocol.

What I want to achieve

  1. I defined ODBC connection and linked server to reach data in the dbase file.
  2. I have created entity for loading data from network analyzer.
  3. I have a workflow to create particular Test protocol (there might be different types of protocols for different engine types).
  4. The Test protocol is displayed in the User Interface step but it is not saved yet.

What user should do:

  1. User is editing Test protocol (in WF User Interface step)
  2. User can click a button Load data from analyzer
  3. Button Load data from analyzer runs another WF and displays all possible values from network analyzer (odbc source)
  4. User selects row and there is Confirm selection button to confirm selection and it runs a new WF just with data from the selected row.
    (so far so good)
  5. Now I would like to run transformation to add these data into Test Protocol. How can I merge the given data? Is there any easy way? I don’t know exactly how Is return value on the context store works or how exactly to work with merge.

Could someone give me a hint how to achieve this user scenario with as less effort as possible :slight_smile: … Idealy there should not be any save into database yet. (or may be just into some temporary table if necessary but it would mean to create a temporary table).

You can apply data to a screen from a Workflow UI Action, which is set to be modal. The input context store to which you pass all the screen’s data will be automatically used to merge them back, if you say so in the action.

So whatever you do in the dialog, make sure you modify the input context store and then the data will appear back in your original screen.

1 Like

Well, I am trying to accomplish it but I am not successful enough:

  1. I open the modal dialog:
  2. Values from analyser is shown:
  3. I select row and press button choose:
  4. Button choose is Workflow button which confirms modal dialog and does the transformation:
  5. Transformation works well and CurrentPhaseL1 value is changed in the result of transformation:
    obrazek
  6. The screen does not get new value:

Do I miss something?

Selecting a row does nothing – it just selects it in the UI. If you want to process it using workflow, you would have to mark it using a checkbox or something like that. Then you would see it marked in the data as well.

That’s one thing.

Can you also post the parameter mapping from the UI action to the workflow? Which one has / as mapping? Only changes in that context store will be merged back.

I don’t agree that selecting the row does nothing :slight_smile:.

This sends to “selection WF” just one value (selected):

obrazek

Setting value:

obrazek

Passed value:

obrazek

Passing Context

I pass protocol into data structure that contains Protocol data and Measurements:

obrazek

Then I pass protocol data into selection wf:

obrazek

obrazek

This passes the Workflow parameter including all measurements. But the data structure is just protocol, so measurements are forgotten:

In the transformation there is full protocol and passed selected measurement.

Note

I didn’t want to use selection boxes because the user would be able to select multiple values but I want him to select just one row. So with the additional wf it works but the merge into original form is not working.

I have a solution

Button “Select data from analyzer”

  1. Button that opens Modal dialog:
     
    Important configurations:

     
    I have already configured it!
     
  2. Passing parameters into workflow - there is a limitation to pass only one parameter with setting / or . (**I had 2 parameters because I was not sure if I can pass attribute of protocolEntity directly into different data structure which contains protocolEntity, which works fine)
     
    obrazek
     
    obrazek
  3. Workflow select data from analyzer>
     

     
    Loads data from different source into Context Store that already contains ProtocolEntity which has been passed as parameter.
     
  4. Selection button
     

     
  5. Selection parameters
     
    obrazek
     
    Main Fix: I needed to pass just one parameter as /. The selection could be done by passing additional parameter but as a value of column. So I can pass primary key into selection workflow to select value which I want.
     
    obrazek
     
    Instead of passing whole entity as ., I pass only primary key column.
    obrazek
     
  6. Value selection workflow
     

     
    Accepts all values from previous workflow (form) and applies transformation by selecting concrete values based on parameter V_MereniMData_Cislo. So no need to load data again, just pass everything from previous workflow, selected row is passed through V_MereniMData_Cislo and it is passed as parameter into transformation where I can refer it this way:
     

Note

  1. The main problem was passing through multiple parameters as whole form entity (.) or entities (/).
  2. The transformation would be little bit easier if I could pass parameter as the whole entity (.) and choose context store which is the return value of the form. The return value does not take any effect. But it works fine now and no additional call to ODBC source is needed.

Thank you for your help, @tvavrda

One additional thing

Is it somehow possible to disable constraints on form submit?

  1. User creates new protocol, there are 2 mandatory fields
  2. User starts workflow Select values from analyzer (I can setup context store to disable constraints, so I can run workflow)
  3. User cannot confirm dialog with Select button because not all fields are filled:

I have tried:

  1. Set every context store as disable constraints
  2. Remove screen section with Protocol from Screen
  3. Remove mandatory fields from the fields in the data structure

Nothing worked. Is it somehow possible to use this functionality when mandatory fields are not filled?

Currently there is no way how to work around having mandatory fields not filled in the UI other than filling them manually or using default values.

The DisableConstraints can be used to prefill a context store with partly values so they could be subsequently displayed in the UI where they require the form to be completed. Another use of it is to pass it through multiple transformations which provide partly values but end up being complete at the end of the chain.

1 Like

Thank you for additional information.

I ended up in the 2 transformations:

  1. I prepare data for screen to select value => I save current values of mandatory fields into another entity in the data structure. Or I could save them into virtual fields in the same entity
  2. I replace current values with default values in the current entity. This will assure that all mandatory fields are filled.
  3. I pass the whole data structure into Value selected workflow.
  4. There is the final transformation which fills the selected values into original entity and restores original values of mandatory fields.

Not very elegant but working :slight_smile:.

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