
plugin-webapp.acm-plugin.app.views.instance.executionsTab.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cockpit-acm-plugin Show documentation
Show all versions of cockpit-acm-plugin Show documentation
This plugin provides information about case definitions and case instances deployed into Camunda BPM. It seamless integrates into Cockpit in the same way, as the corresponding process definition/instance pages.
ngDefine('cockpit.plugin.acm-plugin.views', function(module) {
var ExecutionsCtrl = [ '$scope', 'camundaService', function($scope, camundaService) {
'use strict';
/*
* Filter all running executions
*/
$scope.filterRunningActivities = function(execution) {
return execution.activityName != null && execution.active == true;
};
// retrieve from parent scope
var caseData = $scope.caseData.newChild($scope);
caseData.observe([ 'executions', function(executions) {
$scope.caseInstanceExecutions = executions;
console.log($scope.caseInstanceExecutions);
} ]);
caseData.provide( 'historyExecutions', ['instance', function(instance) {
return camundaService.caseHistory(instance.id);
} ]);
caseData.observe([ 'historyExecutions', function(historyExecutions) {
$scope.caseHistoryExecutions = historyExecutions;
} ]);
// starts execution of a task
$scope.startExecution = function(caseExecutionId) {
camundaService.startExecution(caseExecutionId).then(function(result) {
$scope.ExecutionStartResult = result;
caseData.changed('executions');
});
};
// completes execution of a task
$scope.completeExecution = function(caseExecutionId) {
camundaService.completeExecution(caseExecutionId).then(function(result) {
caseData.changed('executions');
});
};
// opens human task form
$scope.openTaskForm = function(task) {
console.log(task);
};
} ];
module.config([ 'ViewsProvider', function(ViewsProvider) {
ViewsProvider.registerDefaultView('cockpit.caseInstance.runtime.tab', {
id : 'case-steps-table',
label : 'Task Overview',
url : 'plugin://acm-plugin/static/app/views/instance/executionsTab.html',
controller : ExecutionsCtrl,
priority : 30
});
} ]);
return module;
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy