12

We have YAWF (Yet Another Workflow Framework) set up for one of our customers. We have a simple Workflow process, which is working exactly as we require, except for the component version history.

In the version history, instead of the name of the user who has created or updated the component, we only see "Tridion Content Manager System NT Author".

I suspect this is the MTS User account that is used to execute YAWF. However we really need the users name to appear in the version history.

Perhaps we have configured YAWF incorrectly?

Has anybody else had this issue, or got any idea how we can solve it?

We are using Tridion 2011. (Not yet SP1)

Ibrar Hussain
  • 1,791
  • 2
  • 15
  • 19

4 Answers4

4

Would that be the account that executed the last step in your workflow?

You seem pretty convinced it's the YAWF, have you tried without it?

Nuno Linhares
  • 10,214
  • 1
  • 22
  • 42
  • Could it be that last type in your workflow is automatic activity? – Igor Paniushkin Jul 12 '12 at 15:11
  • @Igor Exactly, automatic activities are normally performed by local system, that would certainly explain the author. – Quirijn Jul 13 '12 at 08:53
  • The last activity in my workflow is automatic. So that means every component that goes through workflow has no accurate version history. Is there anyway to make the author of the component appear in the version history when using a workflow process like this? – Ibrar Hussain Jul 13 '12 at 09:10
  • Thanks Jeremy. Just wanted to ask how would a GUI extension help? – Ibrar Hussain Jul 13 '12 at 14:43
  • 1
    I have not played with this, but can we perhaps impersonate the user in the final activity, so that the "FinishActivity" instruction is executed by that user? Or you could add a manual activity that is automatically started and finished by the Event system. – Nuno Linhares Jul 16 '12 at 15:04
3

In general it could be that there are different people working on one version, since a check-in occurs only after all activities are finished.

You could work your way around this issue by iterating through the activity performers, and include a comment in the finish message.

Another option might be to impersonate the author:

Set oTDSE = CreateObject("TDS.TDSE") 
oTDSE.Impersonate("[Author]") 
oTDSE.Initialize() 

' use TDSE 

Set oTDSE = Nothing
Arjen Stobbe
  • 1,684
  • 9
  • 15
0

I realize this is an old question, but I recently battled with this same issue from a Core Service perspective and wanted to share the route I took (and possibly someone will point out where I may have gone wrong before I deploy this to production).

After attempting a few different approaches with Core Service, I settled on adding a final manual activity to my workflows and custom logic to the preceding automatic activity. In the automatic activity's Core Service logic, I finish the current automatic activity (which returns the final manual activity instance), impersonate the original author, start the final activity instance (as the author) and finish that final activity instance (again, as the author).

I am using the SessionAwareCoreServiceClient and running on the Content Manager machine itself. I had to add "NT AUTHORITY\SYSTEM" to the Impersonation Users in the Tridion Content Manager configuration utility (there could be security implications using Impersonate, so make sure it makes sense for your environment):

Impersonation Users

The code looks something like this (although I've left out some things like getting the current activity instance, retrieving the original author from the first manual activity and I added the using SessionAwareCoreServiceClient to give some context):

using (SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient())
{
    ActivityFinishData activityFinish = new ActivityFinishData()
    {
        Message = message,
        NextAssignee = new LinkToTrusteeData() { IdRef = authorUser.IdRef }
    };

    // Finish current automatic activity
    ActivityInstanceData finalActivity = client.FinishActivity(activityInstance.Id, activityFinish, new ReadOptions());

    // Impersonate original author
    client.Impersonate(authorUser.Title);

    // Start final (manual) activity as author - if you don't start it, then non-Administrators can't finish them.
    client.StartActivity(finalActivity.Id, null);
    // Finish final (manual) activity as author
    client.FinishActivity(finalActivity.Id, activityFinish, null);
}

Hopefully I'm not doing anything too terribly stupid and possibly this answer will help someone like myself that had to cobble it together from various other questions/blogs/references and perform a bit of trial-and-error (which can get tedious with workflow).

J Stuart
  • 333
  • 2
  • 8
0

Thats expected behavior. If workflow's last activity is Automatic. It is always performed by Tridion Content Manager System NT Author.The user with which workflow service agent is running. As a work-around you can use J stuarts solution. I did similar one too.

Added another activity atlast as automatic. And performed this activity with the user who created the content originally. That way content is checked in with author details. However, to impersonate in workflow make sure your Tridion machine has impersonation user NT AUTHORITY\SYSTEM with user type Windows.

public void UpdateVersion(string workitemid,string componentid)
    {
        try
        {
            Stopwatch _watch = new Stopwatch();
            _watch.Start();
            Logger.Debug("Entered RPPTridionWorkflow UpdateVersion ");
            WorkItemData workItem = (WorkItemData)CoreServiceClient.Read(workitemid, options);
            ProcessInstanceData processInstance =
                (ProcessInstanceData)CoreServiceClient.Read(workItem.Process.IdRef, options);
            ActivityData creatorActivityData = getActivityDataBasedOnName(workitemid, "Content Creation");
            if (creatorActivityData != null)
            {
                LinkToUserData linktoAuthorUser = creatorActivityData.Owner;
                UserData authorUser = (UserData)CoreServiceClient.Read(linktoAuthorUser.IdRef, options);
                CoreServiceClient.Impersonate(authorUser.Title);
            }
            ActivityData[] ieActivities = processInstance.Activities;
            int currentActivity = ieActivities.Length - 1;
            if (ieActivities != null)
            {
                ActivityInstanceData activityInstance =
                   (ActivityInstanceData)CoreServiceClient.Read(processInstance.Activities[currentActivity].Id, options);

                ActivityFinishData finishData = new ActivityFinishData();
                finishData.Message = "Finished automatically and upded version info for component checked in";
                CoreServiceClient.FinishActivity(activityInstance.Id, finishData, options);
                CoreServiceClient.Close();
            }