I am interested in saving a group of process variables to a data store, and sele

I am interested in saving a group of process variables to a data store, and selectively deleting rows in that data store, or modifying particular entities in the data store. I have not come upon the correct combination of settings that will allow me to do this using combinations of "Delete from Data Store Entity" or using "Query Database". I seem to be adding to my data store when I try to delete, which is described in the documentation if my index is wrong. I am trying to use a process variable as my index, but its a multiple variable, so it looks like "; 3" if I try to delete the third row in my table. Any quick and simple suggestions on how to modify or delete data in data stores?...

OriginalPostID-62243

OriginalPostID-62243

  Discussion posts and replies are publicly visible

Parents
  • Michael, here's an example of an XSD snippet where an "id" field of a CDT is marked as the primary key:
    <xsd:element name="id" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">
    @Id
    @GeneratedValue
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    You need the annotation with an appinfo that has "appian.jpa" as its source. @Id indicates that this field is a PK. This is the minimum that you need in order to correctly update your rows in the DB using the Write to Data Store Entity smart service, and to delete rows using the Delete from Data Store Entities smart service.

    @GeneratedValue is useful if you want your primary key values to be auto-generated each time you insert a row into the DB using the Write to DS smart service. It's a commonly used configuration.

    After you've updated your XSD and reimported your CDT (forum.appian.com/.../Managing_Custom_Data_Types, the "id" field will now be the PK field.
Reply
  • Michael, here's an example of an XSD snippet where an "id" field of a CDT is marked as the primary key:
    <xsd:element name="id" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">
    @Id
    @GeneratedValue
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    You need the annotation with an appinfo that has "appian.jpa" as its source. @Id indicates that this field is a PK. This is the minimum that you need in order to correctly update your rows in the DB using the Write to Data Store Entity smart service, and to delete rows using the Delete from Data Store Entities smart service.

    @GeneratedValue is useful if you want your primary key values to be auto-generated each time you insert a row into the DB using the Write to DS smart service. It's a commonly used configuration.

    After you've updated your XSD and reimported your CDT (forum.appian.com/.../Managing_Custom_Data_Types, the "id" field will now be the PK field.
Children
No Data