【问题标题】:Tridion Workflow Error on EDA_ITEMS_UPDATE Stored Procedure When Restarting WF Activities重新启动 WF 活动时 EDA_ITEMS_UPDATE 存储过程上的 Tridion 工作流错误
【发布时间】:2012-11-03 22:24:28
【问题描述】:

每当工作流的 2 个或更多实例重新启动时,我都会遇到错误。在我们办公室发生网络事件期间,我们暂停了工作流程。脚本超时中断了该过程。我无法再重现此超时,因此我尝试重新启动工作流活动以完成该过程。但是,当我重新启动超过 1 个暂停的活动时,我会收到此错误(完整日志在下方):

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.

重新开始活动,让它一个一个完成没有问题。

完整事件日志:

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

工作流程信息

组件是由另一个应用程序通过 BusinessConnector 新创建的。它在完成活动之前执行修订保存。 WF的目标是

  1. 根据来自其他系统的文本值分配必要的组件链接;
  2. 创建一个页面;
  3. 并将其发布到目标。

我知道这可以通过其他方式做得更好,但现在就是这样,请耐心等待。

模型/架构

Product
    - modelName (text)
    - categoryName (text)
    - categoryCL (component link)
    - statusName (text)
    - statusCL (component link)
    - blah1 (text)
    - blah2 (text)
    - blah3 (text)
    - blah4 (text)

自动活动脚本:

' 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)

我没有放大到它发生的确切位置,但我会假设它是 categoryCL 或 statusCL 的 objComp.Save(True) 行。

【问题讨论】:

  • 这是自动活动吗?如果是这样,你能发布你的脚本吗?如果没有 - 这究竟是什么时候发生的?
  • 您能否添加工作流活动的详细信息以及您用于启动工作流的方法/脚本。也请具体说明错误发生的时间
  • 如果您认为您遇到了产品中的错误,我建议您将问题报告给 SDL 的客户支持。
  • 也许,除了堆栈跟踪之外,您还可以通过提供更多信息和一些上下文来改进您的问题。在没有太多上下文的情况下,很难理解和提供任何答案。
  • 总之,我添加了更多关于我的案例的信息。请停止投票。谢谢。

标签: workflow tridion tridion-2011


【解决方案1】:

我注意到您正在调用 Call objComp.Save(True) - “True”参数强制执行“CheckIn”,因为它的意思是“完成编辑”。

看起来这可能会发生两次(即,如果有一个 statusCL 和一个 categoryCL),这可能是导致问题的原因。我会尝试更改行为,以便您只在最后调用 Save() 方法(如果已进行更改),而不是保存两次。

【讨论】:

    【解决方案2】:

    据我所知,问题在于您试图将空值分配为组件链接。您确定您没有尝试将这两个组件相互链接吗?您尝试创建的链接可能是工作流中的新组件(它还没有签入版本),因此您无法创建指向它的链接。尝试在您的脚本中添加一些日志记录,这样我们就可以看到它到底在哪里失败以及参数是什么。

    我同意 Frank 的观点,即这个例外值得报告缺陷。

    【讨论】:

    • @Lanthe:你找到解决这个问题的方法了吗?我遇到了同样的问题,我们现在没有使用任何工作流程。
    猜你喜欢
    • 2012-08-10
    • 1970-01-01
    • 2011-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-27
    相关资源
    最近更新 更多