000036385 - Advanced Workflow Update Content node fails for questionnaire created with empty required fields in RSA Archer 6.x

Document created by RSA Customer Support Employee on Sep 17, 2018Last modified by RSA Customer Support Employee on Jul 17, 2019
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000036385
Applies ToRSA Product Set: Archer
RSA Version/Condition: 6.x
IssueAn Advanced Workflow job for a questionnaire fails at an Update Content node.  The following error is written to the Advanced Workflow Service log file:

                <TraceRecord Severity="Error" xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord">
                    <Description>Unhandled exception occured: [Script: UpdateContentScript] [NodeId: 44:CUST] [JobId: 4:CUST] [ProcRef: 51ce800e739c61b0]</Description>
---------- Exception ----------
Failed to Update Content for record 11936574
   at ArcherTech.Services.WorkflowService.Scripts.Scripts.CompleteNodeWithErrorCommand`1.Execute(T context)
   at ArcherTech.Utility.ExecutionTask.PlanExecutionCommand`1.Execute(T context)
   at ArcherTech.Services.WorkflowService.Scripts.ScriptController.Run[T](IWorkpointScript workpointScript)
---------- Inner Exception 1 ----------
Token StartElement in state EndRootElement would result in an invalid XML document. Make sure that the ConformanceLevel setting is set to ConformanceLevel.Fragment or ConformanceLevel.Auto if you want to write an XML fragment.
   at System.Xml.XmlWellFormedWriter.ThrowInvalidStateTransition(Token token, State currentState)
   at System.Xml.XmlWellFormedWriter.AdvanceState(Token token)
   at System.Xml.XmlWellFormedWriter.WriteStartElement(String prefix, String localName, String ns)
   at ArcherTech.Services.WorkflowService.Scripts.Utility.ErrorHandlingExtensions.FromValidationMessage(IEnumerable`1 validationMessages)
   at ArcherTech.Services.WorkflowService.Scripts.Scripts.UpdateContentScript.SaveContentCommand.Execute(UpdateContentScriptContext context)
   at ArcherTech.Utility.ExecutionTask.CompositeCommand`1.Execute(T context)
   at ArcherTech.Utility.ExecutionTask.CompositeCommand`1.Execute(T context)
   at ArcherTech.Utility.ExecutionTask.PlanExecutionCommand`1.Execute(T context)</Message>

CauseThe questionnaire's advanced workflow is failing on the Update Content node because there are required fields that have not been populated. 

A questionnaire record can be created with empty required fields. RSA engineering determined that this is working as expected according to ARCHER-28528 "Questionnaire can be saved with empty required fields." 

Once the questionnaire record is created in this state, if AWF tries to update a field, it then needs to save the record. The record save fails validation because of the empty required fields. Thus, the AWF job fails. 
ResolutionArcher Help article "Building Advanced Workflows":
_New Records
Each newly created record is enrolled in the advanced workflow process.
Note: If you are creating an advanced workflow for a questionnaire, keep in mind that questionnaire records are first saved when a user clicks Apply after selecting the target of the assessment (or when the campaign creates and assigns the assessments). If you choose to enroll new records, this means that the record would be enrolled in an advanced workflow before the record is first presented to the user. Keep this in mind in the further design of the questionnaire and workflow. For example, if you have any required fields in the questionnaire, and the workflow proceeds through an Update Content node immediately upon enrollment, the advanced workflow job will enter an error state (unless the required fields have been populated by the workflow). If the workflow design requires the use of required fields, one option is to place the workflow into an Evaluate Content...Wait for Update loop, which can hold the record in that state until a user has populated the fields. Another option is to use a different advanced workflow enrollment option