5

I have a decision activity and using the core service I want to finish the current activity, assign the next person and the next activity. This is working fine for a manual activity where I only need to assign the person.

However, the decision activity also requires the next activity to perform and I don't know how to set it. Here is my error: "The next Workflow Activity has not been selected." Any ideas?

Here is my code so far:

using (SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient(binding))
{
    // Get Component
    var wfItem = client.Read(componentUri, new ReadOptions()) as ComponentData;
    if (wfItem == null)
        return;

    // Get Workflow info for Component
    var activityUri = wfItem.WorkflowInfo.ActivityInstance.IdRef;
    var activityTitle = wfItem.WorkflowInfo.ActivityInstance.Title;

    // Set Finish Message
    ActivityFinishData finishData = new ActivityFinishData();
    finishData.Message = finishMessage;

    // Set Previous performer
    LinkToTrusteeData guiltyPerson = new LinkToTrusteeData();
    TridionHelper tridionHelper = new TridionHelper();
    guiltyPerson.IdRef = tridionHelper.GetPreviousAssigneeUri(componentUri, activityUri, activityTitle);
    finishData.NextAssignee = guiltyPerson;

    // Finish
    client.FinishActivity(activityUri, finishData, new ReadOptions());
}
  • 2
    You need to use the DecisionActivityFinishData. Take a look at this : stackoverflow.com/q/11537828/1269175 – Ram G Jul 30 '13 at 13:11
  • Thanks very much for the suggestion - exactly what I was hoping for. Maybe you should put this as an answer, even if it is answered elsewhere? – robrtc Jul 30 '13 at 13:18
6

Posting answer from Frank here for community users convenience.

You need to use DecisionActivityFinishData instead of of ActivityFinishData.

var decisionActivityFinishData = new DecisionActivityFinishData
{
  NextActivity = new LinkToActivityDefinitionData{IdRef = "next activity ID"}
};
csClient.FinishActivity(currentactivity.Id, decisionActivityFinishData, 
                        readoption);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.