Sitecore查询语言:更新+;哪里

Sitecore查询语言:更新+;哪里,sitecore,query-analyzer,sitecore-workflow,Sitecore,Query Analyzer,Sitecore Workflow,我正试图通过Sitecore Rocks查询分析器使用Sitecore查询语言,在保持当前状态的同时,将一组项目更新为新的工作流。我现在有: update set @#__Workflow state# = "--GUID of the workflow state--" from //*[@@id='--GUID of the parent Item--']/* 这很有效。我想做的是,包括where语句,这样我就可以在切换工作流的同时保持草稿/等待批准/批准状态 update set @#_

我正试图通过Sitecore Rocks查询分析器使用Sitecore查询语言,在保持当前状态的同时,将一组项目更新为新的工作流。我现在有:

update set @#__Workflow state# = "--GUID of the workflow state--" from //*[@@id='--GUID of the parent Item--']/*
这很有效。我想做的是,包括where语句,这样我就可以在切换工作流的同时保持草稿/等待批准/批准状态

update set @#__Workflow state# = "--GUID of the DRAFT workflow state--" from //*[@@id='--GUID of the parent Item--']/* where @#__Workflow state# = "--GUID of the original DRAFT workflow state--";
update set @#__Workflow state# = "--GUID of the APPROVED workflow state--" from //*[@@id='--GUID of the parent Item--']/* where @#__Workflow state# = "--GUID of the original APPROVED workflow state--";
然而,这不起作用。我的where子句是否存在语法问题,或者where不能与Sitecore查询语言中的更新一起使用。

在查询语言中,“where子句”不起作用

您应该使用/*[@fieldName=“value”]来选择项目,如下所示:

update set @#__Workflow state# = "--GUID of the DRAFT workflow state--" from //*[@@id='--GUID of the parent Item--']/*[@#__Workflow state# = "--GUID of the original DRAFT workflow state--"];

update set @#__Workflow state# = "--GUID of the APPROVED workflow state--" from //*[@@id='--GUID of the parent Item--']/*[@#__Workflow state# = "--GUID of the original APPROVED workflow state--"];