Having trouble writing data to data store entity

Hi all,

 

I am a beginner in Appian and I have come across a problem that I've debugged for an hour but can't find the solution to. I'm attempting to write data to a data store entity and I continue to get the following error:

Problem:  An error occurred in executing an Activity Class.

Details:  An error occurred while trying to write to the entity "vehicle_parts" [id=7241da9e-15f3-402f-ae6d-b0f08195974e@87648, type=VFM_Part (id=3724)] (data store: VFM DS CK). Details: java.lang.IllegalArgumentException: The record to be saved must not be null: TypedValue[it=3724,v=<null>] Data: TypedValue[it=3724,v=<null>]

Recommended Action:  Examine the activity class to correct the error and then resume.

Priority of this problem: High Priority

 

Does anyone have any idea how to solve this? If it helps, I'm also having trouble finding the created table after I save and publish my data store with no issues.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    As i can find lot of useful information's related to your query, so here i would like to add few more points into the consideration:

    1. As you did not define @Table annotation, hence the table will be created by the name, same as CDT, for example: VFM_Part => vfmpart
    2. You can open Data Store and Download the DDL script, and check for Create Script is targeting to which table
    3. you can cross check the schema name under ..../suite/admin/ url > Integration > Data Sources
    4. As per my understanding, (if these all configurations are correct then) You are using Write to Data Store Entity Smart Service for storing the data into the corresponding table, so basically the above exception can also be thrown when the row which we are trying to store contains null as it's value (doesn't matter whether the Primary is Auto Generate or not, but value to be inserted must not be null)
    5. If you want to avoid the above case, where there are some changes of empty row to be coming from Process/Interface then try using Write to Multiple Data Store Entity Node, this will avoid empty rows to be inserted into the DB


    I hope above points will you to debug the issue.
Reply
  • 0
    Certified Lead Developer
    As i can find lot of useful information's related to your query, so here i would like to add few more points into the consideration:

    1. As you did not define @Table annotation, hence the table will be created by the name, same as CDT, for example: VFM_Part => vfmpart
    2. You can open Data Store and Download the DDL script, and check for Create Script is targeting to which table
    3. you can cross check the schema name under ..../suite/admin/ url > Integration > Data Sources
    4. As per my understanding, (if these all configurations are correct then) You are using Write to Data Store Entity Smart Service for storing the data into the corresponding table, so basically the above exception can also be thrown when the row which we are trying to store contains null as it's value (doesn't matter whether the Primary is Auto Generate or not, but value to be inserted must not be null)
    5. If you want to avoid the above case, where there are some changes of empty row to be coming from Process/Interface then try using Write to Multiple Data Store Entity Node, this will avoid empty rows to be inserted into the DB


    I hope above points will you to debug the issue.
Children
  • hi here is what the ddl script says
    /* UPDATE DDL */
    /* DROP AND CREATE DDL */
    /* WARNING: The DDL commented out below will drop and re-create all tables.
    drop table if exists `vfmpart`;

    create table `vfmpart` (
    `id` integer not null auto_increment,
    `name` varchar(255),
    `category` varchar(255),
    `manufacturer` varchar(255),
    `cost` double precision,
    primary key (`id`)
    ) ENGINE=InnoDB;
    */

    I'm not understanding why the table created was vfmpart? I think that's where I'm the most confused.
  • 0
    Certified Lead Developer
    in reply to ck0220
    Generally when we create a CDT, and if we don't define @Table Annotation in its XSD, then usually Appian will convert CDT name into small and removing special characters such as _ hence the table will be created by the name vfmpart while publishing the Data Store, that's why it's a best practice to define the Table name using Annotation in its XSD before publishing the Data Store.
    The reason behind by default name generation strategy is, Designer may or may not define the Annotation i.e. @Table in XSD file manually, then Appian must handle that scenario so that the Data Store should get published without any error, hence they define by default an alternate way.
  • I guess I'm just puzzled as to why I'm having this issue because in the last two practice applications I created, I never had to define the table annotation in the XSD; it always saved to the entity I created in the data store. What you're saying definitely makes sense, my question now is how would I change the table name? Because the fact that it is saving to vfmpart tells me that my code is working, I just would need to change the name of something so that it doesn't save to someone else's table that is also named vfmpart, which is what is happening now. so should I change the CDT? or something else? Basically how do I solve this issue now that I know what the issue is?