Add/Update Action not writing to DSE

New designer here; I've created an Action to Add or Update reference data but it is not writing to the database as it should. In monitoring the process it appears to run correctly, but nothing appears in the database. Any help would be appreciated!

OriginalPostID-272969

  Discussion posts and replies are publicly visible

Parents
  • Hi @bryant.st39 and aloks176, thanks for the suggestions. I do think the PV is null - the Alert I keep getting now is attached. I'm not sure how to try using the index function suggested by aloks176 but could you explain what you mean by "do some null handling to see if the PV is null to avoid this error"? I know the PV is null but not how to fix it. "id" is a part of the CDT called "RefData" and although it doesn't display the ID on the Action interface, it should add a new one or update the associated columns for an existing id.

  • 0
    A Score Level 1
    in reply to sarahk8341

    Hello sarahk8341,

    From the screenshots, I am noting a few points which you need to correct.
    The PV CDT you are trying to write to DB is multiple - it is a multiple CDT (array of CDT). But, in the input of the Write to datastore smart service, it is not multiple. The types should match. The RefData input should be multiple in the Write to datastore smart service input.

    Another thing - somehow your Multiple CDT PV is null.
    You can put a check in your process model - using the XOR gateway. Check if the PV is null. If it is null, do not write to the database.
    Another approach would be to use the "Write to Multiple Datastore " smart service. It would avoid the need for null check. Write to Multiple Datastore simply avoids writing to DB if there is no data to write. In this way, Write to Multiple Datastore is more robust.

    Finally, you also need to pinpoint why the Multiple CDT is null in the first place. Maybe something is not working as expected. You are probably passing the value as parameter(I see that from the screenshot). Check why the value is not getting passed. Is this process model getting called from another process model? Or is it getting called from Related action or a web API?
    Whatever be the mechanism, check why the caller of this process model is not able to pass non-null data. Once you find it, it would help you to fix the issue at the source.

  • A problem with the Write to Multiple Data Store Entity is that, during the monitoring of process, the process properties(the icon that opens the PVs window when clicked) will not work in most cases when we are trying to write to multiple entities and this could be because of the weird value(decoded from the constant that holds reference to Data Store Entity) that will be assigned to 'entity' attribute of type!EntityData() list. This makes the debugging a night mare and we need to go to Process Details dashboard to monitor the PVs.

    In order to overcome this, I am doing the following to make sure that process properties option is working properly:

    1. Save the data from Entity Data into corresponding CDTs.

    2. Set the entity fields in EntityData PV to null or Set the entire EntityData PV to null.

Reply
  • A problem with the Write to Multiple Data Store Entity is that, during the monitoring of process, the process properties(the icon that opens the PVs window when clicked) will not work in most cases when we are trying to write to multiple entities and this could be because of the weird value(decoded from the constant that holds reference to Data Store Entity) that will be assigned to 'entity' attribute of type!EntityData() list. This makes the debugging a night mare and we need to go to Process Details dashboard to monitor the PVs.

    In order to overcome this, I am doing the following to make sure that process properties option is working properly:

    1. Save the data from Entity Data into corresponding CDTs.

    2. Set the entity fields in EntityData PV to null or Set the entire EntityData PV to null.

Children
No Data