I am creating a first automated activity "back to author" in workflow using coreservice. The below is my code.
can you please help me on this?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using Tridion.ContentManager.CoreService.Client;
namespace CoreComponentWorkflow
{
[ProgId("CoreComponentWorkflow.WorkflowHandler")]
public class AutomaticWorkflowHandler
{
public void MoveBackToActivity(string strActivitytoMove)
{
var client = new SessionAwareCoreServiceClient();
var finishdata = new ActivityFinishData();
finishdata.Message = strActivitytoMove;
var process = new ProcessInstanceData();
var activity = (ActivityInstanceData)process.Activities[0];
client.FinishActivity(activity.Id, finishdata, new ReadOptions());
}
}
}
There's a few things in your code that need reviewing.
process.Activities[0]
as this process is new.Review your code with some common sense, and try to follow the flow (with remote debugging for instance). Try comparing with the TOM.NET code you had before, it looks like you are just shooting in the dark here.