0

我正在尝试通过 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子句是否存在语法问题,或者不能在 Sitecore 查询语言中将whereupdate结合使用。

4

1 回答 1

1

“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--"];
于 2013-03-12T22:39:37.680 回答