I am making a mistake when two or more workflow instances are reloaded . We suspended work processes during a network incident at our office (s). It was a script timeout that violated the process. I could no longer reproduce this timeout, so I tried to restart the workflow to complete the process. However, when I restart more than one paused action, I get this error (full log below):
Cannot insert the value NULL into column 'ITEM_ID', table 'tridion_cm.dbo.ITEM_ASSOCIATIONS'; column does not allow nulls. INSERT fails. The statement has been terminated.
Restarting actions and the possibility of its completion one by one do not have problems.
Full event log:
An error occurred while executing the Workflow script. The Script Engine returned the following information: SOURCE: Line = 0 Column = 0 Number = -2147220673 Source = Component.Save Description =
<?xml version="1.0" standalone="yes"?> <tcm:Error ErrorCode="8004033F" Category="4" Source="Kernel" Severity="1" xmlns:tcm="http://www.tridion.com/ContentManager/5.0"> <tcm:Line ErrorCode="8004033F" Cause="false" MessageID="16137"><![CDATA[Unable to save Component (tcm:5-32795).]]> <tcm:Token>RESID_4574</tcm:Token> <tcm:Token>RESID_4418</tcm:Token> <tcm:Token>tcm:5-32795</tcm:Token> </tcm:Line> <tcm:Line ErrorCode="8004033F" Cause="true">CDATA[No data found. ETA_ITEMS, U Cannot insert the value NULL into column 'ITEM_ID', table 'tridion_cm.dbo.ITEM_ASSOCIATIONS'; column does not allow nulls. INSERT fails. The statement has been terminated. </tcm:Line> <tcm:Line ErrorCode="8004033F" Cause="false"><![CDATA[A database error occurred while executing Stored Procedure "EDA_ITEMS_UPDATE".]]> <tcm:Token>EDA_ITEMS_UPDATE</tcm:Token> </tcm:Line> <tcm:Details> <tcm:CallStack> <tcm:Location>System.Data.SqlClient.SqlConnection.OnError(SqlException,Boolean)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlInternalConnection.OnError(SqlException,Boolean)</tcm:Location> <tcm:Location>System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(</tcm:Location> <tcm:Location>System.Data.SqlClient.TdsParser.Run(RunBehavior,SqlCommand,SqlDataReader,BulkCopySimpleResultSet,TdsParserStateObject)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader,RunBehavior,String)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior,RunBehavior,Boolean,Boolean)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior,RunBehavior,Boolean,String,DbAsyncResult)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult,String,Boolean)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.ExecuteNonQuery()</tcm:Location> <tcm:Location>Tridion.ContentManager.Data.AdoNet.DatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location> <tcm:Location>Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location> <tcm:Location>Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location> <tcm:Location>Tridion.ContentManager.Data.AdoNet.IdentifiableObjectDataMapper.Tridion.ContentManager.Data.IIdentifiableObjectDataMapper.Update(IdentifiableObjectData)</tcm:Location> <tcm:Location>Tridion.ContentManager.IdentifiableObject.Save(SaveEventArgs)</tcm:Location> <tcm:Location>Tridion.ContentManager.ContentManagement.VersionedItem.Save(Boolean)</tcm:Location> <tcm:Location>Tridion.ContentManager.ContentManagement.VersionedItem.Save()</tcm:Location> <tcm:Location>Tridion.ContentManager.BLFacade.ContentManagement.VersionedItemFacade.UpdateAndCheckIn(UserContext,String,Boolean,Boolean)</tcm:Location> <tcm:Location>XMLState.Save</tcm:Location> <tcm:Location>Component.Save</tcm:Location> </tcm:CallStack> </tcm:Details> </tcm:Error>
HelpFile = HelpContext = 1000440 caused by: Component.Save and description:
<?xml version="1.0" standalone="yes"?> <tcm:Error ErrorCode="8004033F" Category="4" Source="Kernel" Severity="1" xmlns:tcm="http://www.tridion.com/ContentManager/5.0"> <tcm:Line ErrorCode="8004033F" Cause="false" MessageID="16137"><![CDATA[Unable to save Component (tcm:5-32795).]]> <tcm:Token>RESID_4574</tcm:Token> <tcm:Token>RESID_4418</tcm:Token> <tcm:Token>tcm:5-32795</tcm:Token> </tcm:Line> <tcm:Line ErrorCode="8004033F" Cause="true">CDATA[No data found. ETA_ITEMS, U Cannot insert the value NULL into column 'ITEM_ID', table 'tridion_cm.dbo.ITEM_ASSOCIATIONS'; column does not allow nulls. INSERT fails. The statement has been terminated. </tcm:Line> <tcm:Line ErrorCode="8004033F" Cause="false"><![CDATA[A database error occurred while executing Stored Procedure "EDA_ITEMS_UPDATE".]]> <tcm:Token>EDA_ITEMS_UPDATE</tcm:Token> </tcm:Line> <tcm:Details> <tcm:CallStack> <tcm:Location>System.Data.SqlClient.SqlConnection.OnError(SqlException,Boolean)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlInternalConnection.OnError(SqlException,Boolean)</tcm:Location> <tcm:Location>System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(</tcm:Location> <tcm:Location>System.Data.SqlClient.TdsParser.Run(RunBehavior,SqlCommand,SqlDataReader,BulkCopySimpleResultSet,TdsParserStateObject)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader,RunBehavior,String)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior,RunBehavior,Boolean,Boolean)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior,RunBehavior,Boolean,String,DbAsyncResult)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult,String,Boolean)</tcm:Location> <tcm:Location>System.Data.SqlClient.SqlCommand.ExecuteNonQuery()</tcm:Location> <tcm:Location>Tridion.ContentManager.Data.AdoNet.DatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location> <tcm:Location>Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location> <tcm:Location>Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location> <tcm:Location>Tridion.ContentManager.Data.AdoNet.IdentifiableObjectDataMapper.Tridion.ContentManager.Data.IIdentifiableObjectDataMapper.Update(IdentifiableObjectData)</tcm:Location> <tcm:Location>Tridion.ContentManager.IdentifiableObject.Save(SaveEventArgs)</tcm:Location> <tcm:Location>Tridion.ContentManager.ContentManagement.VersionedItem.Save(Boolean)</tcm:Location> <tcm:Location>Tridion.ContentManager.ContentManagement.VersionedItem.Save()</tcm:Location> <tcm:Location>Tridion.ContentManager.BLFacade.ContentManagement.VersionedItemFacade.UpdateAndCheckIn(UserContext,String,Boolean,Boolean)</tcm:Location> <tcm:Location>XMLState.Save</tcm:Location> <tcm:Location>Component.Save</tcm:Location> </tcm:CallStack> </tcm:Details> </tcm:Error>
Source: LogScriptError
Workflow Information
Components are re-created by another application through the BusinessConnector. It performs an audit until the operation is completed. WF's goal is to
- Assign the necessary links to components based on text values ββfrom another system;
- create page;
- and publish it to the goal.
I know that this could be done better by other means, but the way it is right now, please do not forget about the implementation.
Model / Scheme
Product - modelName (text) - categoryName (text) - categoryCL (component link) - statusName (text) - statusCL (component link) - blah1 (text) - blah2 (text) - blah3 (text) - blah4 (text)
Automatic Activity Script:
' COMPONENT WORKFLOW for PRODUCT SCHEMA (START) ' Load common functions ExecuteGlobal oTDSE.GetObject("/webdav/200%20Design/Building%20Blocks/Library/Design/Workflow/Common/Workflow%20Functions.tbbs", 1).Content ' Initialize Set objComp = CurrentWorkItem.GetItem() Set oContentPub = objComp.Publication Set oWebsitePub = oTDSE.GetObject(GetStagingLangPub("EN", "website1"), 1) modelName = objComp.Fields.Item("modelName").Value.Item(1) ' Search and Assign component links based on some text fields from BC client Set compListRowFilter = oTDSE.CreateListRowFilter() Call compListRowFilter.SetCondition("ShowNewItems", TRUE) Call compListRowFilter.SetCondition("ItemType", 16) ' Assign the first component link (categoryCL) categoryName = objComp.Fields.Item("categoryName").Value.Item(1) Set categoryComp = GetObjectFromFolder(categoryName, oTDSE.GetObject(categoryFolderWebDav, 1), compListRowFilter) If Not categoryComp is Nothing Then objComp.Fields.Item("categoryCL").Value.RemoveAll objComp.Fields.Item("categoryCL").Value.Add(categoryComp) Call objComp.Save(True) Else Call SendNoObjectEmail("Category", categoryName, "categoryCL", GetEmailsFromGroup(oContentPub, categoryOwner), "") End if ' Assign the second component link (statusCL) statusName = objComp.Fields.Item("statusName").Value.Item(1) Set statusComp = GetObjectFromFolder(statusName, oTDSE.GetObject(statusFolderWebDav, 1), compListRowFilter) If Not statusComp is Nothing Then objComp.Fields.Item("statusCL").Value.RemoveAll objComp.Fields.Item("statusCL").Value.Add(statusComp) Call objComp.Save(True) Else Call SendNoObjectEmail("Status", statusName, "statusCL", GetEmailsFromGroup(oContentPub, statusOwner), "") End if ' Create a page with the component in WF Set oPage = CreateDefaultPage(modelName, oWebSitePub, SaveToFolderWebDav, PageTemplateWebDav) Call oPage.ComponentPresentations.Add(oWebSitePub, oTDSE.GetObject(ComponentTemplateWebDav, 1)) oPage.Save(True) ' Publish the page .... ' Send email .... ' Finish the Activity Call CurrentWorkItem.ActivityInstance.FinishActivity("someMsg") ' COMPONENT WORKFLOW for PRODUCT SCHEMA (END)
I did not zoom in to where exactly this will happen, but I would suggest that this is either a CL category line or CL objComp.Save(True) .