Cam-script get process information

how to get the process name or process id by the embedded form with cam-script

Hi @MarceloCP,
to get process definition key

var processDefinitionKey = camForm.processDefinitionKey;

to get process instance id

 	    var taskService = camForm.client.resource('task');
      	taskService.get(camForm.taskId, function(err, task) {
        	//alert(JSON.stringify(task));
        	var processInstanceId = task.processInstanceId;
    	});
2 Likes

I put this code in
<script cam-script type="text/form-script"> var processDefinitionKey = camForm.processDefinitionKey; </script>
but how to display the value of the variable “processDefinitionKey” in a label or input text of the same form?

thanks for help

<script cam-script type="text/form-script">

inject(['$scope', function($scope) {
$scope.processDefinitionKey = camForm.processDefinitionKey;
}]);
</script>

<input class="form-control" id="txtProcessDefinitionKey" ng-model="processDefinitionKey" type="text">