The following code works well in my test environment, but not in my UAT environment. Both are running SharePoint 2013.
var ctx = new SP.ClientContext.get_current();
var wfServicesMgr = new SP.WorkflowServices.WorkflowServicesManager(ctx, ctx.get_web());
var wfInteropService = wfServicesMgr.getWorkflowInteropService();
wfInteropService.cancelWorkflow(workflowInstanceId);
ctx.executeQueryAsync(function(source, args){
// Works in one enviroment
}, function (source, args) {
// Results in the following message in another environment
// Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null.
// "GetWorkflowInteropService new Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager()"
var msg = args.get_message();
});
As mentioned in the comments above, the error I see in UAT is:
Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null. "GetWorkflowInteropService new Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager()"
Any ideas? I don't think I need to worry about workflow configuration in either environment since these are 2010 workflows and not 2013 workflows.