1

I want to update metadata of the component during the component is in workflow process using core service. Is that possible?

I understand that when the item is in workflow process, that item is locked.

Jey
  • 2,137
  • 4
  • 22
  • 40

1 Answers1

1

When an item is in workflow, the an activity can be started by members of the group to which that activity belongs. Only the user to whom the item is assigned can then update the content. That implies that if your code is running as the user who started the activity, you can update the item from the code.


Edited to reflect Nuno's comment about only the assigned user being able to update content.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • I want to update using coreservice code, Say for Ex: when the item is moving from one activity to another activity, i want to update the particular component metadata field. I understand that automatic activity is performed by NTAuthority System – Jey Jul 12 '12 at 16:34
  • Have you tried it? I don't think you can change the data, because the item is supposed to be locked in workflow. – Nuno Linhares Jul 12 '12 at 16:42
  • Yes. So you will have to either authenticate you `CoreServiceClient` with the correct user. Alternatively you can impersonate that user, which you can do if you create a `SessionAwareCoreServiceClient`. – Frank van Puffelen Jul 12 '12 at 16:42
  • @Nuno and Frank: I am trying to update the component using the automatic workflow activities. I am getting error " Item is in Workflow" and the automatic activity is performed by the NTAuthority/System. Can i change the content when the item is in workflow or not? am getting session like "CoreServiceSession client = new CoreServiceSession(); SessionAwareCoreServiceClient csClient = client.GetClient();" and Frank says that impersonate the user. How to do that? can i do that for NtAuthority/System – Jey Jul 13 '12 at 11:45
  • `var client = new SessionAwareCoreServiceClient(); client.Impersonate(...);` But by default the system user is not allowed to impersonate. So in that case you should probably simply authenticate that user. I suggest Googling for "authenticate WCF client". – Frank van Puffelen Jul 13 '12 at 12:31