Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
FormTypeEntry ftEntry = setUpFormType(appEntry);
try {
System.out.println("Default State: " + ftEntry.getDeployState());
ftEntry.setDeployState(DeployState.PRODUCTION);
ftEntry = ftEntry.update();
ftEntry = ftEntry.getSelf();
assertEquals("Should be PRODUCTION state", ftEntry.getDeployState(), DeployState.PRODUCTION);

ftEntry.setDeployState(DeployState.DEVELOPMENT);
ftEntry = ftEntry.update();
ftEntry = ftEntry.getSelf();
assertEquals("Should be DEVELOPMENT state", ftEntry.getDeployState(), DeployState.DEVELOPMENT);

FormTypeFeed ftFeed = appEntry.getFormTypeFeed();
FormTypeEntry newEntry = ftFeed.createEntry();
newEntry.setTitle(new PlainTextConstruct("MyForm123"));
newEntry.setSummary(new PlainTextConstruct("MyForm123 Description"));
newEntry.setVisibility(Visibility.PUBLICTENANT);
newEntry.setDeployState(DeployState.PRODUCTION);
newEntry = ftFeed.insert(newEntry);
assertNotNull(newEntry.getSelf());
assertEquals("Should be PRODUCTION state", newEntry.getDeployState(), DeployState.PRODUCTION);
newEntry.delete();

 

...

Why are delete submissions showing up in the submissions feed?

The submissions feed will retrieve all type of submissions: submitted, saved, deleted (Deleted submissions are soft deleted meaning they are marked in the database as deleted, but the records are still present in your DB and so they will be returned in your SubmissonFeed). The   Submissions UI page, by design, shows only the submissions which are completed.

Let's say you want to sort submissions saved versus submitted, then you can use SubmissionEntry.getState() for it. This will return the current state of that particular SubmissionEntry and you can use this property to distinguish between your submissions.