Commit faa8ad71 by yuwei

2.0.0项目初始化

parent ee7d79a5
div[class*='ui-tooltip-flowable-'] {
background-color: #ffffff;
border-color: #c5c5c5;
color: #4a4a4a;
font-family: Verdana;
font-size: 12px;
}
div[class*='ui-tooltip-flowable-'] .qtip-content {
color: #4a4a4a;
background-color: #ffffff;
font-family: Verdana;
font-size: 12px;
}
.ui-tooltip-flowable-cmmn .qtip-titlebar {
color: #FFFFFF;
font-size: 12px;
background: #2B414F;
}
.ui-tooltip-flowable-cmmn .qtip-tip {
background-color: #2B414F;
}
<html>
<head>
<link type="text/css" rel="stylesheet" href="display/jquery.qtip.min.css" />
<link type="text/css" rel="stylesheet" href="display-cmmn/displaymodel.css" />
<script type="text/javascript" src="display/jquery.qtip.min.js"></script>
<script type="text/javascript" src="display/raphael.min.js"></script>
<script type="text/javascript" src="display-cmmn/cmmn-draw.js"></script>
<script type="text/javascript" src="display-cmmn/cmmn-icons.js"></script>
<script type="text/javascript" src="display/Polyline.js"></script>
<script type="text/javascript" src="display-cmmn/displaymodel.js"></script>
</head>
</html>
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var NORMAL_STROKE = 1;
var ASSOCIATION_STROKE = 2;
var TASK_STROKE = 1;
var TASK_HIGHLIGHT_STROKE = 2;
var TEXT_COLOR= "#373e48";
var CURRENT_COLOR= "#017501";
var HOVER_COLOR= "#666666";
var ACTIVITY_STROKE_COLOR = "#bbbbbb";
var ACTIVITY_FILL_COLOR = "#f9f9f9";
var WHITE_FILL_COLOR = "#ffffff";
var MAIN_STROKE_COLOR = "#585858";
var TEXT_PADDING = 3;
var ARROW_WIDTH = 4;
var MARKER_WIDTH = 12;
var TASK_FONT = {font: "11px Arial", opacity: 1, fill: Raphael.rgb(0, 0, 0)};
// icons
var ICON_SIZE = 16;
var ICON_PADDING = 4;
var INITIAL_CANVAS_WIDTH;
var INITIAL_CANVAS_HEIGHT;
var paper;
var viewBox;
var viewBoxWidth;
var viewBoxHeight;
var canvasWidth;
var canvasHeight;
var modelDiv = jQuery('#cmmnModel');
var modelId = modelDiv.attr('data-model-id');
var historyModelId = modelDiv.attr('data-history-id');
var caseDefinitionId = modelDiv.attr('data-case-definition-id');
var modelType = modelDiv.attr('data-model-type');
var elementsAdded = new Array();
var elementsRemoved = new Array();
function _showTip(htmlNode, element)
{
// Default tooltip, no custom tool tip set
if (documentation === undefined) {
var documentation = "";
if (element.name && element.name.length > 0) {
documentation += "<b>Name</b>: <i>" + element.name + "</i><br/><br/>";
}
if (element.properties) {
for (var i = 0; i < element.properties.length; i++) {
var propName = element.properties[i].name;
if (element.properties[i].type && element.properties[i].type === 'list') {
documentation += '<b>' + propName + '</b>:<br/>';
for (var j = 0; j < element.properties[i].value.length; j++) {
documentation += '<i>' + element.properties[i].value[j] + '</i><br/>';
}
}
else {
documentation += '<b>' + propName + '</b>: <i>' + element.properties[i].value + '</i><br/>';
}
}
}
}
var text = element.type + " ";
if (element.name && element.name.length > 0)
{
text += element.name;
}
else
{
text += element.id;
}
htmlNode.qtip({
content: {
text: documentation,
title: {
text: text
}
},
position: {
my: 'top left',
at: 'bottom center',
viewport: jQuery('#cmmnModel')
},
hide: {
fixed: true, delay: 500,
event: 'click mouseleave'
},
style: {
classes: 'ui-tooltip-flowable-cmmn'
}
});
}
function _addHoverLogic(element, type, defaultColor)
{
var strokeColor = _cmmnGetColor(element, defaultColor);
var topBodyRect = null;
if (type === "rect")
{
topBodyRect = paper.rect(element.x, element.y, element.width, element.height);
}
else if (type === "circle")
{
var x = element.x + (element.width / 2);
var y = element.y + (element.height / 2);
topBodyRect = paper.circle(x, y, 15);
}
else if (type === "rhombus")
{
topBodyRect = paper.path("M" + element.x + " " + (element.y + (element.height / 2)) +
"L" + (element.x + (element.width / 2)) + " " + (element.y + element.height) +
"L" + (element.x + element.width) + " " + (element.y + (element.height / 2)) +
"L" + (element.x + (element.width / 2)) + " " + element.y + "z"
);
}
var opacity = 0;
var fillColor = "#ffffff";
if (jQuery.inArray(element.id, elementsAdded) >= 0)
{
opacity = 0.2;
fillColor = "green";
}
if (jQuery.inArray(element.id, elementsRemoved) >= 0)
{
opacity = 0.2;
fillColor = "red";
}
topBodyRect.attr({
"opacity": opacity,
"stroke" : "none",
"fill" : fillColor
});
_showTip(jQuery(topBodyRect.node), element);
topBodyRect.mouseover(function() {
paper.getById(element.id).attr({"stroke":HOVER_COLOR});
});
topBodyRect.mouseout(function() {
paper.getById(element.id).attr({"stroke":strokeColor});
});
}
function _zoom(zoomIn)
{
var tmpCanvasWidth, tmpCanvasHeight;
if (zoomIn)
{
tmpCanvasWidth = canvasWidth * (1.0/0.90);
tmpCanvasHeight = canvasHeight * (1.0/0.90);
}
else
{
tmpCanvasWidth = canvasWidth * (1.0/1.10);
tmpCanvasHeight = canvasHeight * (1.0/1.10);
}
if (tmpCanvasWidth != canvasWidth || tmpCanvasHeight != canvasHeight)
{
canvasWidth = tmpCanvasWidth;
canvasHeight = tmpCanvasHeight;
paper.setSize(canvasWidth, canvasHeight);
}
}
var modelUrl;
if (modelType == 'runtime') {
if (historyModelId) {
modelUrl = FLOWABLE.APP_URL.getCaseInstancesHistoryModelJsonUrl(historyModelId);
} else {
modelUrl = FLOWABLE.APP_URL.getCaseInstancesModelJsonUrl(modelId);
}
} else if (modelType == 'design') {
if (historyModelId) {
modelUrl = FLOWABLE.APP_URL.getModelHistoryModelJsonUrl(modelId, historyModelId);
} else {
modelUrl = FLOWABLE.APP_URL.getModelModelJsonUrl(modelId);
}
} else if (modelType == 'case-definition') {
modelUrl = FLOWABLE.APP_URL.getCaseDefinitionModelJsonUrl(caseDefinitionId);
}
var request = jQuery.ajax({
type: 'get',
url: modelUrl + '?nocaching=' + new Date().getTime()
});
request.success(function(data, textStatus, jqXHR) {
if ((!data.elements || data.elements.length == 0) && (!data.pools || data.pools.length == 0)) return;
INITIAL_CANVAS_WIDTH = data.diagramWidth;
if (modelType == 'design') {
INITIAL_CANVAS_WIDTH += 20;
} else {
INITIAL_CANVAS_WIDTH += 30;
}
INITIAL_CANVAS_HEIGHT = data.diagramHeight + 50;
canvasWidth = INITIAL_CANVAS_WIDTH;
canvasHeight = INITIAL_CANVAS_HEIGHT;
viewBoxWidth = INITIAL_CANVAS_WIDTH;
viewBoxHeight = INITIAL_CANVAS_HEIGHT;
if (modelType == 'design') {
var headerBarHeight = 170;
var offsetY = 0;
if (jQuery(window).height() > (canvasHeight + headerBarHeight))
{
offsetY = (jQuery(window).height() - headerBarHeight - canvasHeight) / 2;
}
if (offsetY > 50) {
offsetY = 50;
}
jQuery('#cmmnModel').css('marginTop', offsetY);
}
jQuery('#cmmnModel').width(INITIAL_CANVAS_WIDTH);
jQuery('#cmmnModel').height(INITIAL_CANVAS_HEIGHT);
paper = Raphael(document.getElementById('cmmnModel'), canvasWidth, canvasHeight);
paper.setViewBox(0, 0, viewBoxWidth, viewBoxHeight, false);
paper.renderfix();
var modelElements = data.elements;
for (var i = 0; i < modelElements.length; i++)
{
var element = modelElements[i];
//try {
var drawFunction = eval("_draw" + element.type);
drawFunction(element);
//} catch(err) {console.log(err);}
}
if (data.flows)
{
for (var i = 0; i < data.flows.length; i++)
{
var flow = data.flows[i];
_drawAssociation(flow);
}
}
});
request.error(function(jqXHR, textStatus, errorThrown) {
alert("error");
});
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({
yeoman: {
app: require('./package.json').appPath || 'app',
dist: 'dist'
},
clean: {
dist: {
files: [
{
dot: true,
src: [
'.tmp',
'<%= yeoman.dist %>/*',
'!<%= yeoman.dist %>/.git*'
]
}
]
},
server: '.tmp'
},
useminPrepare: {
html: 'displaymodel.html',
options: {
dest: '<%= yeoman.dist %>/'
}
},
usemin: {
html: ['<%= yeoman.dist %>/{,*/}*.html'],
css: ['<%= yeoman.dist %>/display/styles/{,*/}*.css'],
options: {
dirs: ['<%= yeoman.dist %>']
}
},
// Put files not handled in other tasks here
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '.',
dest: '<%= yeoman.dist %>',
src: [
'fonts/*'
]
}, {
expand: true,
cwd: '.tmp/images',
dest: '<%= yeoman.dist %>/images',
src: [
'generated/*'
]
}]
},
styles: {
expand: true,
cwd: 'styles',
dest: '.tmp/styles/',
src: '{,*/}*.css'
},
index: {
expand: true,
cwd: './',
src: ['*.html', 'views/**/**.html'],
dest: '<%= yeoman.dist %>'
},
copyCss : {
files: [
{expand: true, cwd:'.tmp/concat/display/styles/', src:'*.css', dest:'<%= yeoman.dist %>/display/styles/', filter: 'isFile'}
]
},
copyJs : {
files: [
{expand: true, cwd:'.tmp/concat/display/scripts', src:'*.js', dest:'<%= yeoman.dist %>/display/scripts/', filter: 'isFile'}
]
},
},
ngAnnotate: {
dist: {
files: [
{
expand: true,
cwd: '.tmp/concat/display/scripts',
src: '*.js',
dest: '.tmp/concat/display/scripts'
}
]
}
},
uglify: {
dist: {
options: {
mangle: true
},
files: {
'<%= yeoman.dist %>/display/scripts/displaymodel-logic.js': [
'<%= yeoman.dist %>/display/scripts/displaymodel-logic.js'
]
}
}
},
rev: {
dist: {
files: {
src: [
'<%= yeoman.dist %>/display/{,*/}*.js',
'<%= yeoman.dist %>/display/{,*/}*.css',
'<%= yeoman.dist %>/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
}
}
}
});
grunt.registerTask('buildApp', [
'clean:dist',
'useminPrepare',
'copy:styles',
'concat',
'copy:dist',
'ngAnnotate',
'copy:copyCss',
'copy:copyJs',
'copy:index',
'uglify',
'rev',
'usemin'
]);
grunt.registerTask('default', [
'buildApp'
]);
};
/* Copyright 2005-2015 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Class to generate polyline
*
* @author Dmitry Farafonov
*/
var ANCHOR_TYPE= {
main: "main",
middle: "middle",
first: "first",
last: "last"
};
function Anchor(uuid, type, x, y) {
this.uuid = uuid;
this.x = x;
this.y = y;
this.type = (type == ANCHOR_TYPE.middle) ? ANCHOR_TYPE.middle : ANCHOR_TYPE.main;
};
Anchor.prototype = {
uuid: null,
x: 0,
y: 0,
type: ANCHOR_TYPE.main,
isFirst: false,
isLast: false,
ndex: 0,
typeIndex: 0
};
function Polyline(uuid, points, strokeWidth, paper) {
/* Array on coordinates:
* points: [{x: 410, y: 110}, 1
* {x: 570, y: 110}, 1 2
* {x: 620, y: 240}, 2 3
* {x: 750, y: 270}, 3 4
* {x: 650, y: 370}]; 4
*/
this.points = points;
/*
* path for graph
* [["M", x1, y1], ["L", x2, y2], ["C", ax, ay, bx, by, x3, y3], ["L", x3, y3]]
*/
this.path = [];
this.anchors = [];
if (strokeWidth) this.strokeWidth = strokeWidth;
this.paper = paper;
this.closePath = false;
this.init();
};
Polyline.prototype = {
id: null,
points: [],
path: [],
anchors: [],
strokeWidth: 1,
radius: 1,
showDetails: false,
paper: null,
element: null,
isDefaultConditionAvailable: false,
closePath: false,
init: function(points){
var linesCount = this.getLinesCount();
if (linesCount < 1)
return;
this.normalizeCoordinates();
// create anchors
this.pushAnchor(ANCHOR_TYPE.first, this.getLine(0).x1, this.getLine(0).y1);
for (var i = 1; i < linesCount; i++)
{
var line1 = this.getLine(i-1);
this.pushAnchor(ANCHOR_TYPE.main, line1.x2, line1.y2);
}
this.pushAnchor(ANCHOR_TYPE.last, this.getLine(linesCount-1).x2, this.getLine(linesCount-1).y2);
this.rebuildPath();
},
normalizeCoordinates: function(){
for(var i=0; i < this.points.length; i++){
this.points[i].x = parseFloat(this.points[i].x);
this.points[i].y = parseFloat(this.points[i].y);
}
},
getLinesCount: function(){
return this.points.length-1;
},
_getLine: function(i){
if (this.points.length > i && this.points[i]) {
return {x1: this.points[i].x, y1: this.points[i].y, x2: this.points[i+1].x, y2: this.points[i+1].y};
} else {
return undefined;
}
},
getLine: function(i){
var line = this._getLine(i);
if (line != undefined) {
line.angle = this.getLineAngle(i);
}
return line;
},
getLineAngle: function(i){
var line = this._getLine(i);
return Math.atan2(line.y2 - line.y1, line.x2 - line.x1);
},
getLineLengthX: function(i){
var line = this.getLine(i);
return (line.x2 - line.x1);
},
getLineLengthY: function(i){
var line = this.getLine(i);
return (line.y2 - line.y1);
},
getLineLength: function(i){
return Math.sqrt(Math.pow(this.getLineLengthX(i), 2) + Math.pow(this.getLineLengthY(i), 2));
},
getAnchors: function(){
return this.anchors;
},
getAnchorsCount: function(type){
if (!type)
return this.anchors.length;
else {
var count = 0;
for(var i=0; i < this.getAnchorsCount(); i++){
var anchor = this.anchors[i];
if (anchor.getType() == type) {
count++;
}
}
return count;
}
},
pushAnchor: function(type, x, y, index){
if (type == ANCHOR_TYPE.first) {
index = 0;
typeIndex = 0;
} else if (type == ANCHOR_TYPE.last) {
index = this.getAnchorsCount();
typeIndex = 0;
} else if (!index) {
index = this.anchors.length;
} else {
for(var i=0; i < this.getAnchorsCount(); i++){
var anchor = this.anchors[i];
if (anchor.index > index) {
anchor.index++;
anchor.typeIndex++;
}
}
}
var anchor = new Anchor(this.id, ANCHOR_TYPE.main, x, y, index, typeIndex);
this.anchors.push(anchor);
},
getAnchor: function(position){
return this.anchors[position];
},
getAnchorByType: function(type, position){
if (type == ANCHOR_TYPE.first)
return this.anchors[0];
if (type == ANCHOR_TYPE.last)
return this.anchors[this.getAnchorsCount()-1];
for(var i=0; i < this.getAnchorsCount(); i++){
var anchor = this.anchors[i];
if (anchor.type == type) {
if( position == anchor.position)
return anchor;
}
}
return null;
},
addNewPoint: function(position, x, y){
//
for(var i = 0; i < this.getLinesCount(); i++){
var line = this.getLine(i);
if (x > line.x1 && x < line.x2 && y > line.y1 && y < line.y2) {
this.points.splice(i+1,0,{x: x, y: y});
break;
}
}
this.rebuildPath();
},
rebuildPath: function(){
var path = [];
for(var i = 0; i < this.getAnchorsCount(); i++){
var anchor = this.getAnchor(i);
var pathType = "";
if (i == 0)
pathType = "M";
else
pathType = "L";
// TODO: save previous points and calculate new path just if points are updated, and then save currents values as previous
var targetX = anchor.x, targetY = anchor.y;
if (i>0 && i < this.getAnchorsCount()-1) {
// get new x,y
var cx = anchor.x, cy = anchor.y;
// pivot point of prev line
var AO = this.getLineLength(i-1);
if (AO < this.radius) {
AO = this.radius;
}
this.isDefaultConditionAvailable = (this.isDefaultConditionAvailable || (i == 1 && AO > 10));
var ED = this.getLineLengthY(i-1) * this.radius / AO;
var OD = this.getLineLengthX(i-1) * this.radius / AO;
targetX = anchor.x - OD;
targetY = anchor.y - ED;
if (AO < 2*this.radius && i>1) {
targetX = anchor.x - this.getLineLengthX(i-1)/2;
targetY = anchor.y - this.getLineLengthY(i-1)/2;;
}
// pivot point of next line
var AO = this.getLineLength(i);
if (AO < this.radius) {
AO = this.radius;
}
var ED = this.getLineLengthY(i) * this.radius / AO;
var OD = this.getLineLengthX(i) * this.radius / AO;
var nextSrcX = anchor.x + OD;
var nextSrcY = anchor.y + ED;
if (AO < 2*this.radius && i<this.getAnchorsCount()-2) {
nextSrcX = anchor.x + this.getLineLengthX(i)/2;
nextSrcY = anchor.y + this.getLineLengthY(i)/2;;
}
var dx0 = (cx - targetX) / 3,
dy0 = (cy - targetY) / 3,
ax = cx - dx0,
ay = cy - dy0,
dx1 = (cx - nextSrcX) / 3,
dy1 = (cy - nextSrcY) / 3,
bx = cx - dx1,
by = cy - dy1,
zx=nextSrcX, zy=nextSrcY;
} else if (i==1 && this.getAnchorsCount() == 2){
var AO = this.getLineLength(i-1);
if (AO < this.radius) {
AO = this.radius;
}
this.isDefaultConditionAvailable = (this.isDefaultConditionAvailable || (i == 1 && AO > 10));
}
// anti smoothing
if (this.strokeWidth%2 == 1) {
targetX += 0.5;
targetY += 0.5;
}
path.push([pathType, targetX, targetY]);
if (i>0 && i < this.getAnchorsCount()-1) {
path.push(["C", ax, ay, bx, by, zx, zy]);
}
}
if (this.closePath)
{
path.push(["Z"]);
}
this.path = path;
},
transform: function(transformation)
{
this.element.transform(transformation);
},
attr: function(attrs)
{
// TODO: foreach and set each
this.element.attr(attrs);
}
};
function Polygone(points, strokeWidth) {
/* Array on coordinates:
* points: [{x: 410, y: 110}, 1
* {x: 570, y: 110}, 1 2
* {x: 620, y: 240}, 2 3
* {x: 750, y: 270}, 3 4
* {x: 650, y: 370}]; 4
*/
this.points = points;
/*
* path for graph
* [["M", x1, y1], ["L", x2, y2], ["C", ax, ay, bx, by, x3, y3], ["L", x3, y3]]
*/
this.path = [];
this.anchors = [];
if (strokeWidth) this.strokeWidth = strokeWidth;
this.closePath = true;
this.init();
};
/*
* Poligone is inherited from Poliline: draws closedPath of polyline
*/
var Foo = function () { };
Foo.prototype = Polyline.prototype;
Polygone.prototype = new Foo();
Polygone.prototype.rebuildPath = function(){
var path = [];
for(var i = 0; i < this.getAnchorsCount(); i++){
var anchor = this.getAnchor(i);
var pathType = "";
if (i == 0)
pathType = "M";
else
pathType = "L";
var targetX = anchor.x, targetY = anchor.y;
// anti smoothing
if (this.strokeWidth%2 == 1) {
targetX += 0.5;
targetY += 0.5;
}
path.push([pathType, targetX, targetY]);
}
if (this.closePath)
path.push(["Z"]);
this.path = path;
};
div[class*='ui-tooltip-kisbpm-'] {
background-color: #ffffff;
border-color: #c5c5c5;
color: #4a4a4a;
font-family: Verdana;
font-size: 12px;
}
div[class*='ui-tooltip-kisbpm-'] .qtip-content {
color: #4a4a4a;
background-color: #ffffff;
font-family: Verdana;
font-size: 12px;
}
.ui-tooltip-kisbpm-bpmn .qtip-titlebar {
color: #FFFFFF;
font-size: 12px;
background: #2B414F;
}
.ui-tooltip-kisbpm-bpmn .qtip-tip {
background-color: #2B414F;
}
<html>
<head>
<!-- build:css display/styles/displaymodel-style.css -->
<link type="text/css" rel="stylesheet" href="display/jquery.qtip.min.css" />
<link type="text/css" rel="stylesheet" href="display/displaymodel.css" />
<!-- endbuild -->
<!-- build:js display/scripts/displaymodel-logic.js -->
<script type="text/javascript" src="display/jquery.qtip.min.js"></script>
<script type="text/javascript" src="display/raphael.min.js"></script>
<script type="text/javascript" src="display/bpmn-draw.js"></script>
<script type="text/javascript" src="display/bpmn-icons.js"></script>
<script type="text/javascript" src="display/Polyline.js"></script>
<script type="text/javascript" src="display/displaymodel.js"></script>
<!-- endbuild -->
</head>
</html>
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var NORMAL_STROKE = 1;
var SEQUENCEFLOW_STROKE = 1.5;
var ASSOCIATION_STROKE = 2;
var TASK_STROKE = 1;
var TASK_HIGHLIGHT_STROKE = 2;
var CALL_ACTIVITY_STROKE = 2;
var ENDEVENT_STROKE = 3;
var COMPLETED_COLOR= "#2632aa";
var TEXT_COLOR= "#373e48";
var CURRENT_COLOR= "#017501";
var HOVER_COLOR= "#666666";
var ACTIVITY_STROKE_COLOR = "#bbbbbb";
var ACTIVITY_FILL_COLOR = "#f9f9f9";
var MAIN_STROKE_COLOR = "#585858";
var TEXT_PADDING = 3;
var ARROW_WIDTH = 4;
var MARKER_WIDTH = 12;
var TASK_FONT = {font: "11px Arial", opacity: 1, fill: Raphael.rgb(0, 0, 0)};
// icons
var ICON_SIZE = 16;
var ICON_PADDING = 4;
var INITIAL_CANVAS_WIDTH;
var INITIAL_CANVAS_HEIGHT;
var paper;
var viewBox;
var viewBoxWidth;
var viewBoxHeight;
var canvasWidth;
var canvasHeight;
var modelDiv = jQuery('#bpmnModel');
var modelId = modelDiv.attr('data-model-id');
var historyModelId = modelDiv.attr('data-history-id');
var processDefinitionId = modelDiv.attr('data-process-definition-id');
var modelType = modelDiv.attr('data-model-type');
// Support for custom background colors for activities
var customActivityColors = modelDiv.attr('data-activity-color-mapping');
if (customActivityColors !== null && customActivityColors !== undefined && customActivityColors.length > 0) {
// Stored on the attribute as a string
customActivityColors = JSON.parse(customActivityColors);
}
var customActivityToolTips = modelDiv.attr('data-activity-tooltips');
if (customActivityToolTips !== null && customActivityToolTips !== undefined && customActivityToolTips.length > 0) {
// Stored on the attribute as a string
customActivityToolTips = JSON.parse(customActivityToolTips);
}
// Support for custom opacity for activity backgrounds
var customActivityBackgroundOpacity = modelDiv.attr('data-activity-opacity');
var elementsAdded = new Array();
var elementsRemoved = new Array();
function _showTip(htmlNode, element)
{
// Custom tooltip
var documentation = undefined;
if (customActivityToolTips) {
if (customActivityToolTips[element.name]) {
documentation = customActivityToolTips[element.name];
} else if (customActivityToolTips[element.id]) {
documentation = customActivityToolTips[element.id];
} else {
documentation = ''; // Show nothing if custom tool tips are enabled
}
}
// Default tooltip, no custom tool tip set
if (documentation === undefined) {
var documentation = "";
if (element.name && element.name.length > 0) {
documentation += "<b>Name</b>: <i>" + element.name + "</i><br/><br/>";
}
if (element.properties) {
for (var i = 0; i < element.properties.length; i++) {
var propName = element.properties[i].name;
if (element.properties[i].type && element.properties[i].type === 'list') {
documentation += '<b>' + propName + '</b>:<br/>';
for (var j = 0; j < element.properties[i].value.length; j++) {
documentation += '<i>' + element.properties[i].value[j] + '</i><br/>';
}
}
else {
documentation += '<b>' + propName + '</b>: <i>' + element.properties[i].value + '</i><br/>';
}
}
}
}
var text = element.type + " ";
if (element.name && element.name.length > 0)
{
text += element.name;
}
else
{
text += element.id;
}
htmlNode.qtip({
content: {
text: documentation,
title: {
text: text
}
},
position: {
my: 'top left',
at: 'bottom center',
viewport: jQuery('#bpmnModel')
},
hide: {
fixed: true, delay: 500,
event: 'click mouseleave'
},
style: {
classes: 'ui-tooltip-kisbpm-bpmn'
}
});
}
function _addHoverLogic(element, type, defaultColor)
{
var strokeColor = _bpmnGetColor(element, defaultColor);
var topBodyRect = null;
if (type === "rect")
{
topBodyRect = paper.rect(element.x, element.y, element.width, element.height);
}
else if (type === "circle")
{
var x = element.x + (element.width / 2);
var y = element.y + (element.height / 2);
topBodyRect = paper.circle(x, y, 15);
}
else if (type === "rhombus")
{
topBodyRect = paper.path("M" + element.x + " " + (element.y + (element.height / 2)) +
"L" + (element.x + (element.width / 2)) + " " + (element.y + element.height) +
"L" + (element.x + element.width) + " " + (element.y + (element.height / 2)) +
"L" + (element.x + (element.width / 2)) + " " + element.y + "z"
);
}
var opacity = 0;
var fillColor = "#ffffff";
if (jQuery.inArray(element.id, elementsAdded) >= 0)
{
opacity = 0.2;
fillColor = "green";
}
if (jQuery.inArray(element.id, elementsRemoved) >= 0)
{
opacity = 0.2;
fillColor = "red";
}
topBodyRect.attr({
"opacity": opacity,
"stroke" : "none",
"fill" : fillColor
});
_showTip(jQuery(topBodyRect.node), element);
topBodyRect.mouseover(function() {
paper.getById(element.id).attr({"stroke":HOVER_COLOR});
});
topBodyRect.mouseout(function() {
paper.getById(element.id).attr({"stroke":strokeColor});
});
}
function _zoom(zoomIn)
{
var tmpCanvasWidth, tmpCanvasHeight;
if (zoomIn)
{
tmpCanvasWidth = canvasWidth * (1.0/0.90);
tmpCanvasHeight = canvasHeight * (1.0/0.90);
}
else
{
tmpCanvasWidth = canvasWidth * (1.0/1.10);
tmpCanvasHeight = canvasHeight * (1.0/1.10);
}
if (tmpCanvasWidth != canvasWidth || tmpCanvasHeight != canvasHeight)
{
canvasWidth = tmpCanvasWidth;
canvasHeight = tmpCanvasHeight;
paper.setSize(canvasWidth, canvasHeight);
}
}
var modelUrl;
if (modelType == 'runtime') {
if (historyModelId) {
modelUrl = FLOWABLE.APP_URL.getProcessInstanceModelJsonHistoryUrl(historyModelId);
} else {
modelUrl = FLOWABLE.APP_URL.getProcessInstanceModelJsonUrl(modelId);
}
} else if (modelType == 'design') {
if (historyModelId) {
modelUrl = FLOWABLE.APP_URL.getModelHistoryModelJsonUrl(modelId, historyModelId);
} else {
modelUrl = FLOWABLE.APP_URL.getModelModelJsonUrl(modelId);
}
} else if (modelType == 'process-definition') {
modelUrl = FLOWABLE.APP_URL.getProcessDefinitionModelJsonUrl(processDefinitionId);
}
var request = jQuery.ajax({
type: 'get',
url: modelUrl + '?nocaching=' + new Date().getTime()
});
request.success(function(data, textStatus, jqXHR) {
if ((!data.elements || data.elements.length == 0) && (!data.pools || data.pools.length == 0)) return;
INITIAL_CANVAS_WIDTH = data.diagramWidth;
if (modelType == 'design') {
INITIAL_CANVAS_WIDTH += 20;
} else {
INITIAL_CANVAS_WIDTH += 30;
}
INITIAL_CANVAS_HEIGHT = data.diagramHeight + 50;
canvasWidth = INITIAL_CANVAS_WIDTH;
canvasHeight = INITIAL_CANVAS_HEIGHT;
viewBoxWidth = INITIAL_CANVAS_WIDTH;
viewBoxHeight = INITIAL_CANVAS_HEIGHT;
if (modelType == 'design') {
var headerBarHeight = 170;
var offsetY = 0;
if (jQuery(window).height() > (canvasHeight + headerBarHeight))
{
offsetY = (jQuery(window).height() - headerBarHeight - canvasHeight) / 2;
}
if (offsetY > 50) {
offsetY = 50;
}
jQuery('#bpmnModel').css('marginTop', offsetY);
}
jQuery('#bpmnModel').width(INITIAL_CANVAS_WIDTH);
jQuery('#bpmnModel').height(INITIAL_CANVAS_HEIGHT);
paper = Raphael(document.getElementById('bpmnModel'), canvasWidth, canvasHeight);
paper.setViewBox(0, 0, viewBoxWidth, viewBoxHeight, false);
paper.renderfix();
if (data.pools)
{
for (var i = 0; i < data.pools.length; i++)
{
var pool = data.pools[i];
_drawPool(pool);
}
}
var modelElements = data.elements;
for (var i = 0; i < modelElements.length; i++)
{
var element = modelElements[i];
//try {
var drawFunction = eval("_draw" + element.type);
drawFunction(element);
//} catch(err) {console.log(err);}
}
if (data.flows)
{
for (var i = 0; i < data.flows.length; i++)
{
var flow = data.flows[i];
if (flow.type === 'sequenceFlow') {
_drawFlow(flow);
} else if (flow.type === 'association') {
_drawAssociation(flow);
}
}
}
});
request.error(function(jqXHR, textStatus, errorThrown) {
alert("error");
});
/* qTip2 v2.2.0 basic css3 | qtip2.com | Licensed MIT, GPL | Wed Dec 18 2013 05:02:24 */
.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:400 bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border-width:1px;border-style:solid;border-color:#F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111} .qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1} .qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030} .qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0} .qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252} .qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0} .qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-rounded .qtip-titlebar{-moz-border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border-width:0;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,#000));background-image:-webkit-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,#000 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px #000}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10px;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10px}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}x:-o-prefocus,.qtip .qtip-tip{visibility:hidden}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml,.qtip .qtip-tip canvas{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:0;top:0;width:100%;height:100%}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}
\ No newline at end of file
{
"name": "displaymodel",
"version": "1.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "0.4.2",
"grunt-autoprefixer": "0.4.0",
"grunt-bower-install": "0.7.0",
"grunt-concurrent": "0.4.1",
"grunt-contrib-clean": "0.5.0",
"grunt-contrib-coffee": "0.7.0",
"grunt-contrib-compass": "0.6.0",
"grunt-contrib-concat": "0.3.0",
"grunt-contrib-connect": "0.5.0",
"grunt-contrib-copy": "0.4.1",
"grunt-contrib-cssmin": "0.7.0",
"grunt-contrib-htmlmin": "0.1.3",
"grunt-contrib-imagemin": "0.3.0",
"grunt-contrib-jshint": "0.7.1",
"grunt-contrib-uglify": "0.2.0",
"grunt-contrib-watch": "0.5.2",
"grunt-google-cdn": "0.2.0",
"grunt-newer": "0.5.4",
"grunt-ng-annotate": "0.5.0",
"grunt-rev": "0.1.0",
"grunt-svgmin": "0.2.0",
"grunt-usemin": "2.0.0",
"jshint-stylish": "0.1.3",
"load-grunt-tasks": "0.2.0",
"time-grunt": "0.2.1",
"grunt-text-replace": "0.3.11",
"grunt-contrib-rename": "0.0.3"
},
"engines": {
"node": ">=0.8.0"
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
FLOWABLE.HEADER_CONFIG.showAppTitle = false;
FLOWABLE.HEADER_CONFIG.showHeaderMenu = false;
FLOWABLE.HEADER_CONFIG.showMainNavigation = false;
FLOWABLE.HEADER_CONFIG.showPageHeader = false;
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Create custom functions for the FLOWABLE-editor
FLOWABLE.TOOLBAR.ACTIONS.closeEditor = function(services) {
if (services.editorManager && services.editorManager.getStencilData()) {
var stencilNameSpace = services.editorManager.getStencilData().namespace;
if (stencilNameSpace !== undefined && stencilNameSpace !== null && stencilNameSpace.indexOf('cmmn1.1') !== -1) {
services.$location.path("/casemodels");
return;
}
}
services.$location.path("/processes");
};
FLOWABLE.TOOLBAR.ACTIONS.navigateToProcess = function(processId) {
var navigateEvent = {
type: FLOWABLE.eventBus.EVENT_TYPE_NAVIGATE_TO_PROCESS,
processId: processId
};
FLOWABLE.eventBus.dispatch(FLOWABLE.eventBus.EVENT_TYPE_NAVIGATE_TO_PROCESS, navigateEvent);
},
// Add custom buttons
FLOWABLE.TOOLBAR_CONFIG.secondaryItems.push(
{
"type" : "button",
"title" : "Close",
"cssClass" : "glyphicon glyphicon-remove",
"action" : "FLOWABLE.TOOLBAR.ACTIONS.closeEditor"
}
);
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Call activity calledElement type property
*/
angular.module('flowableModeler').controller('FlowableCalledElementTypeCtrl', [ '$scope', function($scope) {
if ($scope.property.value == undefined && $scope.property.value == null)
{
$scope.property.value = 'key';
}
$scope.calledElementTypeChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableCaseReferenceCtrl',
[ '$scope', '$modal', '$http', function($scope, $modal, $http) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/case-reference-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableCaseReferencePopupCtrl', [ '$scope', '$http', 'editorManager', function($scope, $http, editorManager) {
$scope.state = {'loadingCases' : true, 'error' : false};
// Close button handler
$scope.close = function() {
$scope.property.mode = 'read';
$scope.$hide();
};
// Selecting/deselecting a case
$scope.selectCase = function(caseModel, $event) {
$event.stopPropagation();
if ($scope.selectedCase && $scope.selectedCase.id && caseModel.id == $scope.selectedCase.id) {
// un-select the current selection
$scope.selectedCase = null;
} else {
$scope.selectedCase = caseModel;
}
};
// Saving the selected value
$scope.save = function() {
if ($scope.selectedCase) {
$scope.property.value = {'id' : $scope.selectedCase.id, 'name' : $scope.selectedCase.name};
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.loadCases = function() {
var modelMetaData = editorManager.getBaseModelData();
$http.get(FLOWABLE.APP_URL.getCaseModelsUrl('?excludeId=' + modelMetaData.modelId))
.success(
function(response) {
$scope.state.loadingCases = false;
$scope.state.caseError = false;
$scope.caseModels = response.data;
})
.error(
function(data, status, headers, config) {
$scope.state.loadingCases = false;
$scope.state.caseError = true;
});
};
if ($scope.property && $scope.property.value && $scope.property.value.id) {
$scope.selectedCase = $scope.property.value;
}
$scope.loadCases();
}]);
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Condition expression
*/
angular.module('flowableModeler').controller('FlowableConditionExpressionCtrl', [ '$scope', '$modal', function($scope, $modal) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/condition-expression-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableConditionExpressionPopupCtrl',
[ '$rootScope', '$scope', '$translate', 'FormBuilderService', function($rootScope, $scope, $translate, FormBuilderService) {
// Put json representing assignment on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.expression !== undefined
&& $scope.property.value.expression !== null) {
$scope.expression = $scope.property.value.expression;
} else if ($scope.property.value !== undefined && $scope.property.value !== null) {
$scope.expression = {type: 'static', staticValue: $scope.property.value};
} else {
$scope.expression = {};
}
$scope.save = function() {
$scope.property.value = {expression: $scope.expression};
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
// Close button handler
$scope.close = function() {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* String controller
*/
angular.module('flowableModeler').controller('FlowableStringPropertyCtrl', [ '$scope', function ($scope) {
$scope.shapeId = $scope.selectedShape.id;
$scope.valueFlushed = false;
/** Handler called when input field is blurred */
$scope.inputBlurred = function() {
$scope.valueFlushed = true;
if ($scope.property.value) {
$scope.property.value = $scope.property.value.replace(/(<([^>]+)>)/ig,"");
}
$scope.updatePropertyInModel($scope.property);
};
$scope.enterPressed = function(keyEvent) {
// if enter is pressed
if (keyEvent && keyEvent.which === 13) {
keyEvent.preventDefault();
$scope.inputBlurred(); // we want to do the same as if the user would blur the input field
}
// else; do nothing
};
$scope.$on('$destroy', function controllerDestroyed() {
if(!$scope.valueFlushed) {
if ($scope.property.value) {
$scope.property.value = $scope.property.value.replace(/(<([^>]+)>)/ig,"");
}
$scope.updatePropertyInModel($scope.property, $scope.shapeId);
}
});
}]);
/*
* Boolean controller
*/
angular.module('flowableModeler').controller('FlowableBooleanPropertyCtrl', ['$scope', function ($scope) {
$scope.changeValue = function() {
if ($scope.property.key === 'oryx-defaultflow' && $scope.property.value) {
var selectedShape = $scope.selectedShape;
if (selectedShape) {
var incomingNodes = selectedShape.getIncomingShapes();
if (incomingNodes && incomingNodes.length > 0) {
// get first node, since there can be only one for a sequence flow
var rootNode = incomingNodes[0];
var flows = rootNode.getOutgoingShapes();
if (flows && flows.length > 1) {
// in case there are more flows, check if another flow is already defined as default
for (var i = 0; i < flows.length; i++) {
if (flows[i].resourceId != selectedShape.resourceId) {
var defaultFlowProp = flows[i].properties.get('oryx-defaultflow');
if (defaultFlowProp) {
flows[i].setProperty('oryx-defaultflow', false, true);
}
}
}
}
}
}
}
$scope.updatePropertyInModel($scope.property);
};
}]);
/*
* Text controller
*/
angular.module('flowableModeler').controller('FlowableTextPropertyCtrl', [ '$scope', '$modal', '$timeout', function($scope, $modal, $timeout) {
var opts = {
template: 'editor-app/configuration/properties/text-popup.html?version=' + Date.now(),
scope: $scope,
prefixEvent: 'textModalEvent'
};
$scope.$on('textModalEvent.hide.before', function() {
$timeout(function() {
$scope.property.mode = 'read';
}, 0);
});
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableTextPropertyPopupCtrl', ['$scope', function($scope) {
$scope.save = function() {
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.close = function() {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Due date
*/
'use strict';
angular.module('flowableModeler').controller('BpmnEditorDueDateCtrl', [ '$scope', '$modal', function($scope, $modal) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/duedate-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('BpmnEditorDueDatePopupCtrl',
[ '$rootScope', '$scope', '$translate', function($rootScope, $scope, $translate) {
// Put json representing assignment on scope
if ($scope.property.value !== undefined && $scope.property.value !== null) {
if ($scope.property.value.duedate !== undefined && $scope.property.value.duedate !== null) {
$scope.popup = {'duedate': $scope.property.value.duedate};
} else if ($scope.property.value.duedateExpression !== undefined && $scope.property.value.duedateExpression !== null) {
$scope.popup = {'duedateExpression': $scope.property.value.duedateExpression};
} else {
$scope.popup = {'duedateExpression': $scope.property.value};
}
} else {
$scope.popup = {};
}
$scope.taskDueDateOptions = [
{id: "none", title: $translate.instant('PROPERTY.DUEDATE.TASK-DUE-DATE-OPTIONS.NO-DUEDATE')},
{id: "expression", title: $translate.instant('PROPERTY.DUEDATE.TASK-DUE-DATE-OPTIONS.EXPRESSION')},
{id: "static", title: $translate.instant('PROPERTY.DUEDATE.TASK-DUE-DATE-OPTIONS.STATIC')},
{id: "field", title: $translate.instant('PROPERTY.DUEDATE.TASK-DUE-DATE-OPTIONS.FIELD')}
];
if (!$scope.popup.duedate && !$scope.popup.duedateExpression) {
// Default, first time opening the popup
$scope.popup.selectedDueDateOption = $scope.taskDueDateOptions[0].id;
} else if (!$scope.popup.duedate) {
$scope.popup.selectedDueDateOption = $scope.taskDueDateOptions[1].id;
} else {
if ($scope.popup.duedate.fixed) {
$scope.popup.selectedDueDateOption = $scope.taskDueDateOptions[2].id;
} else if ($scope.popup.duedate.field) {
$scope.popup.selectedDueDateOption = $scope.taskDueDateOptions[3].id;
} else {
$scope.popup.selectedDueDateOption = $scope.taskDueDateOptions[0].id;
}
}
$scope.dueDateOptionChanged = function() {
if ($scope.popup.selectedDueDateOption === 'expression') {
$scope.popup.duedate = undefined;
} else if ($scope.popup.selectedDueDateOption === 'none') {
$scope.popup.duedate = undefined;
$scope.popup.duedateExpression = undefined;
} else if ($scope.popup.selectedDueDateOption === 'static') {
$scope.popup.duedate = {'fixed': {}};
$scope.popup.duedateExpression = undefined;
} else if ($scope.popup.selectedDueDateOption === 'field') {
$scope.popup.duedate = {'field': {}};
$scope.popup.duedateExpression = undefined;
}
};
$scope.setAddCalculationType = function() {
$scope.popup.duedate.field.taskDueDateCalculationType = 'add';
};
$scope.setSubtractCalculationType = function() {
$scope.popup.duedate.field.taskDueDateCalculationType = 'subtract';
};
$scope.allSteps = EDITOR.UTIL.collectSortedElementsFromPrecedingElements($scope.selectedShape);
$scope.save = function () {
$scope.property.value = {};
if ($scope.popup.duedate) {
$scope.property.value.duedate = $scope.popup.duedate;
} else if ($scope.popup.duedateExpression) {
$scope.property.value.duedateExpression = $scope.popup.duedateExpression;
} else {
$scope.property.value = '';
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
// Close button handler
$scope.close = function() {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Escalation definitions
*/
angular.module('flowableModeler').controller('FlowableEscalationDefinitionsCtrl', ['$scope', '$modal', function ($scope, $modal) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/escalation-definitions-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
//Need a separate controller for the modal window due to https://github.com/angular-ui/bootstrap/issues/259
// Will be fixed in a newer version of Angular UI
angular.module('flowableModeler').controller('FlowableEscalationDefinitionsPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing signal definitions on scope
if ($scope.property.value !== undefined && $scope.property.value !== null && $scope.property.value.length > 0) {
if ($scope.property.value.constructor == String) {
$scope.escalationDefinitions = JSON.parse($scope.property.value);
}
else {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.escalationDefinitions = angular.copy($scope.property.value);
}
} else {
$scope.escalationDefinitions = [];
}
// Array to contain selected signal definitions (yes - we only can select one, but ng-grid isn't smart enough)
$scope.selectedEscalationDefinition = undefined;
$scope.translationsRetrieved = false;
$scope.labels = {};
var idPromise = $translate('PROPERTY.ESCALATIONDEFINITIONS.ID');
var namePromise = $translate('PROPERTY.ESCALATIONDEFINITIONS.NAME');
$q.all([idPromise, namePromise]).then(function (results) {
$scope.labels.idLabel = results[0];
$scope.labels.nameLabel = results[1];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.escalationDefinitions,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [
{field: 'id', displayName: $scope.labels.idLabel},
{field: 'name', displayName: $scope.labels.nameLabel}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedEscalationDefinition = row.entity;
});
};
});
// Click handler for add button
$scope.addNewEscalationDefinition = function () {
var newEscalationDefinition = {id: '', name: ''};
$scope.escalationDefinitions.push(newEscalationDefinition);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newEscalationDefinition);
});
};
// Click handler for remove button
$scope.removeEscalationDefinition = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.escalationDefinitions.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.escalationDefinitions.splice(index, 1);
if ($scope.escalationDefinitions.length == 0) {
$scope.selectedEscalationDefinition = undefined;
}
$timeout(function () {
if ($scope.escalationDefinitions.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.escalationDefinitions[0]);
}
});
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.escalationDefinitions.length > 0) {
$scope.property.value = $scope.escalationDefinitions;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableEscalationRefCtrl', [ '$scope', function($scope) {
// Find the parent shape on which the signal definitions are defined
var escalationDefinitionsProperty = undefined;
var parent = $scope.selectedShape;
while (parent !== null && parent !== undefined && escalationDefinitionsProperty === undefined) {
if (parent.properties && parent.properties.get('oryx-escalationdefinitions')) {
escalationDefinitionsProperty = parent.properties.get('oryx-escalationdefinitions');
} else {
parent = parent.parent;
}
}
try {
escalationDefinitionsProperty = JSON.parse(escalationDefinitionsProperty);
if (typeof escalationDefinitionsProperty == 'string') {
escalationDefinitionsProperty = JSON.parse(escalationDefinitionsProperty);
}
} catch (err) {
// Do nothing here, just to be sure we try-catch it
}
$scope.escalationDefinitions = escalationDefinitionsProperty;
$scope.escalationChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableEventRegistryChannelTypeCtrl', [ '$scope', function($scope) {
if ($scope.property.value == undefined && $scope.property.value == null)
{
$scope.property.value = 'None';
}
$scope.channelTypeChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Input parameters for call activity
*/
angular.module('flowableModeler').controller('FlowableEventCorrelationParametersCtrl',
['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/event-correlation-parameters-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableEventCorrelationParametersPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing form properties on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.correlationParameters !== undefined
&& $scope.property.value.correlationParameters !== null) {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.parameters = angular.copy($scope.property.value.correlationParameters);
} else {
$scope.parameters = [];
}
$scope.translationsRetrieved = false;
$scope.labels = {};
var parameterName = $translate('PROPERTY.EVENTCORRELATIONPARAMETERS.NAME');
var parameterType = $translate('PROPERTY.EVENTCORRELATIONPARAMETERS.TYPE');
$q.all([parameterName, parameterType]).then(function (results) {
$scope.labels.parameterName = results[0];
$scope.labels.parameterType = results[1];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.parameters,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [
{field: 'name', displayName: $scope.labels.parameterName},
{field: 'type', displayName: $scope.labels.parameterType}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedParameter = row.entity;
});
};
});
// Click handler for add button
$scope.addNewParameter = function () {
var newParameter = {
name: '',
type: 'string',
value: ''
};
$scope.parameters.push(newParameter);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newParameter);
});
};
// Click handler for remove button
$scope.removeParameter = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.parameters.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.parameters.splice(index, 1);
if ($scope.parameters.length == 0) {
$scope.selectedParameter = undefined;
}
$timeout(function () {
if ($scope.parameters.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.parameters[0]);
}
});
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.parameters.length > 0) {
$scope.property.value = {};
$scope.property.value.correlationParameters = $scope.parameters;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.close();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Input parameters for call activity
*/
angular.module('flowableModeler').controller('FlowableEventInParametersCtrl',
['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/event-in-parameters-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableEventInParametersPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing form properties on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.inParameters !== undefined
&& $scope.property.value.inParameters !== null) {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.parameters = angular.copy($scope.property.value.inParameters);
} else {
$scope.parameters = [];
}
$scope.translationsRetrieved = false;
$scope.labels = {};
var variableNameLabel = $translate('PROPERTY.EVENTINPARAMETERS.VARIABLENAME');
var eventNameLabel = $translate('PROPERTY.EVENTINPARAMETERS.EVENTNAME');
$q.all([variableNameLabel, eventNameLabel]).then(function (results) {
$scope.labels.variableNameLabel = results[1];
$scope.labels.eventNameLabel = results[0];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.parameters,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [
{field: 'variableName', displayName: $scope.labels.variableNameLabel},
{field: 'eventName', displayName: $scope.labels.eventNameLabel}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedParameter = row.entity;
});
};
});
// Click handler for add button
$scope.addNewParameter = function () {
var newParameter = {
variableName: '',
eventName: '',
eventType: 'string'
};
$scope.parameters.push(newParameter);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newParameter);
});
};
// Click handler for remove button
$scope.removeParameter = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.parameters.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.parameters.splice(index, 1);
if ($scope.parameters.length == 0) {
$scope.selectedParameter = undefined;
}
$timeout(function () {
if ($scope.parameters.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.parameters[0]);
}
});
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.parameters.length > 0) {
$scope.property.value = {};
$scope.property.value.inParameters = $scope.parameters;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.close();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Input parameters for call activity
*/
angular.module('flowableModeler').controller('FlowableEventOutParametersCtrl',
['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/event-out-parameters-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableEventOutParametersPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing form properties on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.outParameters !== undefined
&& $scope.property.value.outParameters !== null) {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.parameters = angular.copy($scope.property.value.outParameters);
} else {
$scope.parameters = [];
}
$scope.translationsRetrieved = false;
$scope.labels = {};
var eventNameLabel = $translate('PROPERTY.EVENTOUTPARAMETERS.EVENTNAME');
var variableNameLabel = $translate('PROPERTY.EVENTOUTPARAMETERS.VARIABLENAME');
$q.all([eventNameLabel, variableNameLabel]).then(function (results) {
$scope.labels.eventNameLabel = results[0];
$scope.labels.variableNameLabel = results[1];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.parameters,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [
{field: 'eventName', displayName: $scope.labels.eventNameLabel},
{field: 'variableName', displayName: $scope.labels.variableNameLabel}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedParameter = row.entity;
});
};
});
// Click handler for add button
$scope.addNewParameter = function () {
var newParameter = {
eventName: '',
eventType: 'string',
variableName: ''
};
$scope.parameters.push(newParameter);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newParameter);
});
};
// Click handler for remove button
$scope.removeParameter = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.parameters.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.parameters.splice(index, 1);
if ($scope.parameters.length == 0) {
$scope.selectedParameter = undefined;
}
$timeout(function () {
if ($scope.parameters.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.parameters[0]);
}
});
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.parameters.length > 0) {
$scope.property.value = {};
$scope.property.value.outParameters = $scope.parameters;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.close();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Task listeners
*/
angular.module('flowableModeler').controller('FlowableExceptionsCtrl',
['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/exceptions-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableExceptionsPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing form properties on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.exceptions !== undefined
&& $scope.property.value.exceptions !== null) {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.exceptions = angular.copy($scope.property.value.exceptions);
} else {
$scope.exceptions = [];
}
$scope.translationsRetrieved = false;
$scope.labels = {};
var codePromise = $translate('PROPERTY.EXCEPTIONS.CODE');
var classPromise = $translate('PROPERTY.EXCEPTIONS.CLASS');
$q.all([codePromise, classPromise]).then(function (results) {
$scope.labels.codeLabel = results[0];
$scope.labels.classLabel = results[1];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.exceptions,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [{field: 'code', displayName: $scope.labels.codeLabel},
{field: 'class', displayName: $scope.labels.classLabel}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedException = row.entity;
});
};
});
$scope.exceptionDetailsChanged = function () {
if ($scope.selectedException.class != '') {
$scope.selectedException.class = $scope.selectedException.class;
}
};
// Click handler for add button
$scope.addNewException = function () {
var newException = {
code: '',
class: '',
children: false
};
$scope.exceptions.push(newException);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newException);
});
};
// Click handler for remove button
$scope.removeException = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.exceptions.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.exceptions.splice(index, 1);
if ($scope.exceptions.length == 0) {
$scope.selectedException = undefined;
}
$timeout(function () {
if ($scope.exceptions.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.exceptions[0]);
}
});
}
};
// Click handler for up button
$scope.moveExceptionUp = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.exceptions.indexOf(selectedItems[0]);
if (index != 0) { // If it's the first, no moving up of course
var temp = $scope.exceptions[index];
$scope.exceptions.splice(index, 1);
$timeout(function () {
$scope.exceptions.splice(index + -1, 0, temp);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for down button
$scope.moveExceptionDown = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.exceptions.indexOf(selectedItems[0]);
if (index != $scope.exceptions.length - 1) { // If it's the last element, no moving down of course
var temp = $scope.exceptions[index];
$scope.exceptions.splice(index, 1);
$timeout(function () {
$scope.exceptions.splice(index + 1, 0, temp);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.exceptions.length > 0) {
$scope.property.value = {};
$scope.property.value.exceptions = $scope.exceptions;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.$hide();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Task listeners
*/
angular.module('flowableModeler').controller('FlowableFieldsCtrl',
['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/fields-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableFieldsPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing form properties on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.fields !== undefined
&& $scope.property.value.fields !== null) {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.fields = angular.copy($scope.property.value.fields);
for (var i = 0; i < $scope.fields.length; i++) {
var field = $scope.fields[i];
if (field.stringValue !== undefined && field.stringValue !== '') {
field.implementation = field.stringValue;
}
else if (field.expression !== undefined && field.expression !== '') {
field.implementation = field.expression;
}
else if (field.string !== undefined && field.string !== '') {
field.implementation = field.string;
}
}
} else {
$scope.fields = [];
}
$scope.translationsRetrieved = false;
$scope.labels = {};
var namePromise = $translate('PROPERTY.FIELDS.NAME');
var implementationPromise = $translate('PROPERTY.FIELDS.IMPLEMENTATION');
$q.all([namePromise, implementationPromise]).then(function (results) {
$scope.labels.nameLabel = results[0];
$scope.labels.implementationLabel = results[1];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.fields,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [{field: 'name', displayName: $scope.labels.nameLabel},
{field: 'implementation', displayName: $scope.labels.implementationLabel}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedField = row.entity;
});
};
});
$scope.fieldDetailsChanged = function () {
if ($scope.selectedField.stringValue != '') {
$scope.selectedField.implementation = $scope.selectedField.stringValue;
}
else if ($scope.selectedField.expression != '') {
$scope.selectedField.implementation = $scope.selectedField.expression;
}
else if ($scope.selectedField.string != '') {
$scope.selectedField.implementation = $scope.selectedField.string;
}
else {
$scope.selectedField.implementation = '';
}
};
// Click handler for add button
$scope.addNewField = function () {
var newField = {
name: 'fieldName',
implementation: '',
stringValue: '',
expression: '',
string: ''
};
$scope.fields.push(newField);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newField);
});
};
// Click handler for remove button
$scope.removeField = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.fields.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.fields.splice(index, 1);
if ($scope.fields.length == 0) {
$scope.selectedField = undefined;
}
$timeout(function () {
if ($scope.fields.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.fields[0]);
}
});
}
};
// Click handler for up button
$scope.moveFieldUp = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.fields.indexOf(selectedItems[0]);
if (index != 0) { // If it's the first, no moving up of course
var temp = $scope.fields[index];
$scope.fields.splice(index, 1);
$timeout(function () {
$scope.fields.splice(index + -1, 0, temp);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for down button
$scope.moveFieldDown = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.fields.indexOf(selectedItems[0]);
if (index != $scope.fields.length - 1) { // If it's the last element, no moving down of course
var temp = $scope.fields[index];
$scope.fields.splice(index, 1);
$timeout(function () {
$scope.fields.splice(index + 1, 0, temp);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.fields.length > 0) {
$scope.property.value = {};
$scope.property.value.fields = $scope.fields;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.$hide();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableFormReferenceDisplayCtrl',
[ '$scope', '$modal', '$http', function($scope, $modal, $http) {
if ($scope.property && $scope.property.value && $scope.property.value.id) {
$http.get(FLOWABLE.APP_URL.getModelUrl($scope.property.value.id))
.success(
function(response) {
$scope.form = {
id: response.id,
name: response.name
};
});
}
}]);
angular.module('flowableModeler').controller('FlowableFormReferenceCtrl',
[ '$scope', '$modal', '$http', function($scope, $modal, $http) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/form-reference-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl',
[ '$rootScope', '$scope', '$http', '$location', 'editorManager', function($rootScope, $scope, $http, $location, editorManager) {
$scope.state = {'loadingForms' : true, 'formError' : false};
$scope.popup = {'state' : 'formReference'};
$scope.foldersBreadCrumbs = [];
// Close button handler
$scope.close = function() {
$scope.property.mode = 'read';
$scope.$hide();
};
// Selecting/deselecting a subprocess
$scope.selectForm = function(form, $event) {
$event.stopPropagation();
if ($scope.selectedForm && $scope.selectedForm.id && form.id == $scope.selectedForm.id) {
// un-select the current selection
$scope.selectedForm = null;
} else {
$scope.selectedForm = form;
}
};
// Saving the selected value
$scope.save = function() {
if ($scope.selectedForm) {
$scope.property.value = {
'id' : $scope.selectedForm.id,
'name' : $scope.selectedForm.name,
'key' : $scope.selectedForm.key
};
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
// Open the selected value
$scope.open = function() {
if ($scope.selectedForm) {
$scope.property.value = {
'id' : $scope.selectedForm.id,
'name' : $scope.selectedForm.name,
'key' : $scope.selectedForm.key
};
$scope.updatePropertyInModel($scope.property);
var modelMetaData = editorManager.getBaseModelData();
var json = editorManager.getModel();
json = JSON.stringify(json);
var params = {
modeltype: modelMetaData.model.modelType,
json_xml: json,
name: modelMetaData.name,
key: modelMetaData.key,
description: modelMetaData.description,
newversion: false,
lastUpdated: modelMetaData.lastUpdated
};
// Update
$http({ method: 'POST',
data: params,
ignoreErrors: true,
headers: {'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
transformRequest: function (obj) {
var str = [];
for (var p in obj) {
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
}
return str.join("&");
},
url: FLOWABLE.URL.putModel(modelMetaData.modelId)})
.success(function (data, status, headers, config) {
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_SAVED
});
var allSteps = EDITOR.UTIL.collectSortedElementsFromPrecedingElements($scope.selectedShape);
$rootScope.addHistoryItem($scope.selectedShape.resourceId);
$location.path('form-editor/' + $scope.selectedForm.id);
})
.error(function (data, status, headers, config) {
});
$scope.close();
}
};
$scope.newForm = function() {
$scope.popup.state = 'newForm';
var modelMetaData = editorManager.getBaseModelData();
$scope.model = {
loading: false,
form: {
name: '',
key: '',
description: '',
modelType: 2
}
};
};
$scope.createForm = function() {
if (!$scope.model.form.name || $scope.model.form.name.length == 0 ||
!$scope.model.form.key || $scope.model.form.key.length == 0) {
return;
}
$scope.model.loading = true;
$http({method: 'POST', url: FLOWABLE.APP_URL.getModelsUrl(), data: $scope.model.form}).
success(function(data, status, headers, config) {
var newFormId = data.id;
$scope.property.value = {
'id' : newFormId,
'name' : data.name,
'key' : data.key
};
$scope.updatePropertyInModel($scope.property);
var modelMetaData = editorManager.getBaseModelData();
var json = editorManager.getModel();
json = JSON.stringify(json);
var params = {
modeltype: modelMetaData.model.modelType,
json_xml: json,
name: modelMetaData.name,
key: modelMetaData.key,
description: modelMetaData.description,
newversion: false,
lastUpdated: modelMetaData.lastUpdated
};
// Update
$http({ method: 'POST',
data: params,
ignoreErrors: true,
headers: {'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
transformRequest: function (obj) {
var str = [];
for (var p in obj) {
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
}
return str.join("&");
},
url: FLOWABLE.URL.putModel(modelMetaData.modelId)})
.success(function (data, status, headers, config) {
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_SAVED
});
$scope.model.loading = false;
$scope.$hide();
var allSteps = EDITOR.UTIL.collectSortedElementsFromPrecedingElements($scope.selectedShape);
$rootScope.addHistoryItem($scope.selectedShape.resourceId);
$location.path('form-editor/' + newFormId);
})
.error(function (data, status, headers, config) {
$scope.model.loading = false;
$scope.$hide();
});
}).
error(function(data, status, headers, config) {
$scope.model.loading = false;
$scope.model.errorMessage = data.message;
});
};
$scope.cancel = function() {
$scope.close();
};
$scope.loadForms = function() {
var modelMetaData = editorManager.getBaseModelData();
$http.get(FLOWABLE.APP_URL.getFormModelsUrl())
.success(
function(response) {
$scope.state.loadingForms = false;
$scope.state.formError = false;
$scope.forms = response.data;
})
.error(
function(data, status, headers, config) {
$scope.state.loadingForms = false;
$scope.state.formError = true;
});
};
if ($scope.property && $scope.property.value && $scope.property.value.id) {
$scope.selectedForm = $scope.property.value;
}
$scope.loadForms();
}]);
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableHttpRequestMethodCtrl', [ '$scope', function($scope) {
if ($scope.property.value == undefined && $scope.property.value == null)
{
$scope.property.value = 'GET';
}
$scope.httpRequestMethodChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Input parameters for call activity
*/
angular.module('flowableModeler').controller('FlowableInParametersCtrl',
['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/in-parameters-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableInParametersPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing form properties on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.inParameters !== undefined
&& $scope.property.value.inParameters !== null) {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.parameters = angular.copy($scope.property.value.inParameters);
} else {
$scope.parameters = [];
}
$scope.translationsRetrieved = false;
$scope.labels = {};
var sourcePromise = $translate('PROPERTY.PARAMETER.SOURCE');
var sourceExpressionPromise = $translate('PROPERTY.PARAMETER.SOURCEEXPRESSION');
var targetPromise = $translate('PROPERTY.PARAMETER.TARGET');
var targetExpressionPromise = $translate('PROPERTY.PARAMETER.TARGETEXPRESSION');
$q.all([sourcePromise, sourceExpressionPromise, targetPromise, targetExpressionPromise]).then(function (results) {
$scope.labels.sourceLabel = results[0];
$scope.labels.sourceExpressionLabel = results[1];
$scope.labels.targetLabel = results[2];
$scope.labels.targetExpressionLabel = results[3];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.parameters,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [
{field: 'source', displayName: $scope.labels.sourceLabel},
{field: 'sourceExpression', displayName: $scope.labels.sourceExpressionLabel},
{field: 'target', displayName: $scope.labels.targetLabel},
{field: 'targetExpression', displayName: $scope.labels.targetExpressionLabel}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedParameter = row.entity;
});
};
});
// Click handler for add button
$scope.addNewParameter = function () {
var newParameter = {
source: '',
sourceExpression: '',
target: '',
targetExpression: ''
};
$scope.parameters.push(newParameter);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newParameter);
});
};
// Click handler for remove button
$scope.removeParameter = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.parameters.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.parameters.splice(index, 1);
if ($scope.parameters.length == 0) {
$scope.selectedParameter = undefined;
}
$timeout(function () {
if ($scope.parameters.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.parameters[0]);
}
});
}
};
// Click handler for up button
$scope.moveParameterUp = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.parameters.indexOf(selectedItems[0]);
if (index != 0) { // If it's the first, no moving up of course
var temp = $scope.parameters[index];
$scope.parameters.splice(index, 1);
$timeout(function () {
$scope.parameters.splice(index + -1, 0, temp);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for down button
$scope.moveParameterDown = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.parameters.indexOf(selectedItems[0]);
if (index != $scope.parameters.length - 1) { // If it's the last element, no moving down of course
var temp = $scope.parameters[index];
$scope.parameters.splice(index, 1);
$timeout(function () {
$scope.parameters.splice(index + 1, 0, temp);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.parameters.length > 0) {
$scope.property.value = {};
$scope.property.value.inParameters = $scope.parameters;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.close();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Execution listeners
*/
angular.module('flowableModeler').controller('FlowableMessageDefinitionsCtrl', ['$scope', '$modal', function ($scope, $modal) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/message-definitions-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
//Need a separate controller for the modal window due to https://github.com/angular-ui/bootstrap/issues/259
// Will be fixed in a newer version of Angular UI
angular.module('flowableModeler').controller('FlowableMessageDefinitionsPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing mesage definitions on scope
if ($scope.property.value !== undefined && $scope.property.value !== null && $scope.property.value.length > 0) {
if ($scope.property.value.constructor == String) {
$scope.messageDefinitions = JSON.parse($scope.property.value);
}
else {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.messageDefinitions = angular.copy($scope.property.value);
}
} else {
$scope.messageDefinitions = [];
}
// Array to contain selected mesage definitions (yes - we only can select one, but ng-grid isn't smart enough)
$scope.selectedMessageDefinition = undefined;
$scope.translationsRetrieved = false;
$scope.labels = {};
var idPromise = $translate('PROPERTY.MESSAGEDEFINITIONS.ID');
var namePromise = $translate('PROPERTY.MESSAGEDEFINITIONS.NAME');
$q.all([idPromise, namePromise]).then(function (results) {
$scope.labels.idLabel = results[0];
$scope.labels.nameLabel = results[1];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.messageDefinitions,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [
{field: 'id', displayName: $scope.labels.idLabel},
{field: 'name', displayName: $scope.labels.nameLabel}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedMessageDefinition = row.entity;
});
};
});
// Click handler for add button
$scope.addNewMessageDefinition = function () {
var newMessageDefinition = {id: '', name: ''};
$scope.messageDefinitions.push(newMessageDefinition);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newMessageDefinition);
});
};
// Click handler for remove button
$scope.removeMessageDefinition = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.messageDefinitions.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.messageDefinitions.splice(index, 1);
if ($scope.messageDefinitions.length == 0) {
$scope.selectedMesageDefinition = undefined;
}
$timeout(function () {
if ($scope.messageDefinitions.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.messageDefinitions[0]);
}
});
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.messageDefinitions.length > 0) {
$scope.property.value = $scope.messageDefinitions;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableMessageRefCtrl', [ '$scope', function($scope) {
// Find the parent shape on which the message definitions are defined
var messageDefinitionsProperty = undefined;
var parent = $scope.selectedShape;
while (parent !== null && parent !== undefined && messageDefinitionsProperty === undefined) {
if (parent.properties && parent.properties.get('oryx-messagedefinitions')) {
messageDefinitionsProperty = parent.properties.get('oryx-messagedefinitions');
} else {
parent = parent.parent;
}
}
try {
messageDefinitionsProperty = JSON.parse(messageDefinitionsProperty);
if (typeof messageDefinitionsProperty == 'string') {
messageDefinitionsProperty = JSON.parse(messageDefinitionsProperty);
}
} catch (err) {
// Do nothing here, just to be sure we try-catch it
}
$scope.messageDefinitions = messageDefinitionsProperty;
$scope.messageChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableMultiInstanceCtrl', [ '$scope', function($scope) {
if ($scope.property.value == undefined && $scope.property.value == null)
{
$scope.property.value = 'None';
}
$scope.multiInstanceChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Adhoc sub process ordering property
*/
angular.module('flowableModeler').controller('FlowableOrderingCtrl', [ '$scope', function($scope) {
if ($scope.property.value == undefined && $scope.property.value == null)
{
$scope.property.value = 'Parallel';
}
$scope.orderingChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Input parameters for call activity
*/
angular.module('flowableModeler').controller('FlowableOutParametersCtrl',
['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/out-parameters-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableOutParametersPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing form properties on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.outParameters !== undefined
&& $scope.property.value.outParameters !== null) {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.parameters = angular.copy($scope.property.value.outParameters);
} else {
$scope.parameters = [];
}
$scope.translationsRetrieved = false;
$scope.labels = {};
var sourcePromise = $translate('PROPERTY.PARAMETER.SOURCE');
var sourceExpressionPromise = $translate('PROPERTY.PARAMETER.SOURCEEXPRESSION');
var targetPromise = $translate('PROPERTY.PARAMETER.TARGET');
var targetExpressionPromise = $translate('PROPERTY.PARAMETER.TARGETEXPRESSION');
$q.all([sourcePromise, sourceExpressionPromise, targetPromise, targetExpressionPromise]).then(function (results) {
$scope.labels.sourceLabel = results[0];
$scope.labels.sourceExpressionLabel = results[1];
$scope.labels.targetLabel = results[2];
$scope.labels.targetExpressionLabel = results[3];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.parameters,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [{field: 'source', displayName: $scope.labels.sourceLabel},
{field: 'sourceExpression', displayName: $scope.labels.sourceExpressionLabel},
{field: 'target', displayName: $scope.labels.targetLabel},
{field: 'targetExpression', displayName: $scope.labels.targetExpressionLabel}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedParameter = row.entity;
});
};
});
// Click handler for add button
$scope.addNewParameter = function () {
var newParameter = {
source: '',
sourceExpression: '',
target: '',
targetExpression: ''};
$scope.parameters.push(newParameter);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newParameter);
});
};
// Click handler for remove button
$scope.removeParameter = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.parameters.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.parameters.splice(index, 1);
if ($scope.parameters.length == 0) {
$scope.selectedParameter = undefined;
}
$timeout(function () {
if ($scope.parameters.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.parameters[0]);
}
});
}
};
// Click handler for up button
$scope.moveParameterUp = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.parameters.indexOf(selectedItems[0]);
if (index != 0) { // If it's the first, no moving up of course
var temp = $scope.parameters[index];
$scope.parameters.splice(index, 1);
$timeout(function () {
$scope.parameters.splice(index + -1, 0, temp);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for down button
$scope.moveParameterDown = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.parameters.indexOf(selectedItems[0]);
if (index != $scope.parameters.length - 1) { // If it's the last element, no moving down of course
var temp = $scope.parameters[index];
$scope.parameters.splice(index, 1);
$timeout(function () {
$scope.parameters.splice(index + 1, 0, temp);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.parameters.length > 0) {
$scope.property.value = {};
$scope.property.value.outParameters = $scope.parameters;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.close();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowablePlanItemDropdownCtrl', [ '$scope', function($scope) {
// Find all planitems
var selectedShape = $scope.selectedShape;
if (selectedShape) {
// Go up in parent chain until plan model is found
var planModel;
var parent = selectedShape.parent;
if (parent) {
while (planModel === undefined && parent !== null && parent !== undefined) {
if (parent.resourceId !== null && parent.resourceId !== undefined && 'casePlanModel' === parent.resourceId) {
planModel = parent;
} else {
parent = parent.parent;
}
}
}
var planItems = [];
if (planModel !== null && planModel !== undefined) {
var toVisit = [];
for (var i=0; i<planModel.children.length; i++) {
toVisit.push(planModel.children[i]);
}
while (toVisit.length > 0) {
var child = toVisit.pop();
if (typeof child.getStencil === 'function'
&& (child.getStencil()._jsonStencil.groups.indexOf('Activities') >= 0 || (child.getStencil()._jsonStencil.title === 'Stage') )) {
planItems.push(child);
}
if (child.children !== null && child.children !== undefined) {
for (var i=0; i<child.children.length; i++) {
toVisit.push(child.children[i]);
}
}
}
}
var simplifiedPlanItems = [];
for (var i=0; i<planItems.length; i++) {
simplifiedPlanItems.push({ id: planItems[i].resourceId, name: planItems[i].properties.get('oryx-name') });
}
if (simplifiedPlanItems.length > 0) {
simplifiedPlanItems.sort(function(a,b) {
if(a.name < b.name) {
return -1;
} else if (a.name > b.name) {
return 1;
} else {
return 0;
}
});
}
$scope.planItems = simplifiedPlanItems;
}
if ($scope.property.value == undefined && $scope.property.value == null) {
$scope.property.value = '';
}
$scope.planItemChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableProcessHistoryLevelCtrl', [ '$scope', function($scope) {
if ($scope.property.value == undefined && $scope.property.value == null)
{
$scope.property.value = 'None';
}
$scope.historyLevelChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableProcessReferenceCtrl',
[ '$scope', '$modal', '$http', function($scope, $modal, $http) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/process-reference-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableProcessReferencePopupCtrl', [ '$scope', '$http', function($scope, $http) {
$scope.state = {'loadingProcesses' : true, 'error' : false};
// Close button handler
$scope.close = function() {
$scope.property.mode = 'read';
$scope.$hide();
};
// Selecting/deselecting a process
$scope.selectProcess = function(processModel, $event) {
$event.stopPropagation();
if ($scope.selectedProcess && $scope.selectedProcess.id && processModel.id == $scope.selectedProcess.id) {
// un-select the current selection
$scope.selectedProcess = null;
} else {
$scope.selectedProcess = processModel;
}
};
// Saving the selected value
$scope.save = function() {
if ($scope.selectedProcess) {
$scope.property.value = {'id' : $scope.selectedProcess.id, 'name' : $scope.selectedProcess.name};
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.loadProcesses = function() {
$http.get(FLOWABLE.APP_URL.getModelsUrl("?modelType=0"))
.success(
function(response) {
$scope.state.loadingProcesses = false;
$scope.state.processError = false;
$scope.processModels = response.data;
})
.error(
function(data, status, headers, config) {
$scope.state.loadingProcesses = false;
$scope.state.processError = true;
});
};
if ($scope.property && $scope.property.value && $scope.property.value.id) {
$scope.selectedProcess = $scope.property.value;
}
$scope.loadProcesses();
}]);
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Sequence flow order controller
*/
angular.module('flowableModeler').controller('FlowableSequenceFlowOrderCtrl',
[ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/sequenceflow-order-popup.html?version=' + Date.now(),
scope: $scope
};
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableSequenceFlowOrderPopupCtrl',
['$scope', '$translate', function($scope, $translate) {
// Find the outgoing sequence flow of the current selected shape
var outgoingSequenceFlow = [];
var selectedShape = $scope.selectedShape;
if (selectedShape) {
var outgoingNodes = selectedShape.getOutgoingShapes();
for (var i=0; i<outgoingNodes.length; i++) {
if (outgoingNodes[i].getStencil().idWithoutNs() === 'SequenceFlow') {
var targetActivity = outgoingNodes[i].getTarget();
// We need the resourceId of a sequence flow, not the id because that will change with every editor load
outgoingSequenceFlow.push({
id : outgoingNodes[i].resourceId,
targetTitle : targetActivity.properties.get('oryx-name'),
targetType : $translate.instant(targetActivity.getStencil().title())
});
}
}
} else {
console.log('Programmatic error: no selected shape found');
}
// Now we can apply the order which was (possibly) previously saved
var orderedOutgoingSequenceFlow = [];
if ($scope.property.value && $scope.property.value.sequenceFlowOrder) {
var sequenceFlowOrderList = $scope.property.value.sequenceFlowOrder;
// Loop the list of sequence flow that was saved in the json model and match them with the outgoing sequence flow found above
for (var flowIndex=0; flowIndex < sequenceFlowOrderList.length; flowIndex++) {
// find the sequence flow in the outgoing sequence flows.
for (var outgoingFlowIndex=0; outgoingFlowIndex < outgoingSequenceFlow.length; outgoingFlowIndex++) {
if (outgoingSequenceFlow[outgoingFlowIndex].id === sequenceFlowOrderList[flowIndex]) {
orderedOutgoingSequenceFlow.push(outgoingSequenceFlow[outgoingFlowIndex]);
outgoingSequenceFlow.splice(outgoingFlowIndex, 1);
break;
}
}
}
// Now all the matching sequence flow we're removed from the outgoing sequence flow list
// We can simply apply the remaining ones (these are new vs. the time when the values were saved to the model)
orderedOutgoingSequenceFlow = orderedOutgoingSequenceFlow.concat(outgoingSequenceFlow);
} else {
orderedOutgoingSequenceFlow = outgoingSequenceFlow;
}
// Now we can put it on the scope
$scope.outgoingSequenceFlow = orderedOutgoingSequenceFlow;
// Move up click handler
$scope.moveUp = function(index) {
var temp = $scope.outgoingSequenceFlow[index];
$scope.outgoingSequenceFlow[index] = $scope.outgoingSequenceFlow[index - 1];
$scope.outgoingSequenceFlow[index - 1] = temp;
};
// Move down click handler
$scope.moveDown = function(index) {
var temp = $scope.outgoingSequenceFlow[index];
$scope.outgoingSequenceFlow[index] = $scope.outgoingSequenceFlow[index + 1];
$scope.outgoingSequenceFlow[index + 1] = temp;
};
// Save click handler
$scope.save = function() {
if ($scope.outgoingSequenceFlow.length > 0) {
$scope.property.value = {};
$scope.property.value.sequenceFlowOrder = [];
for (var flowIndex=0; flowIndex < $scope.outgoingSequenceFlow.length; flowIndex++) {
$scope.property.value.sequenceFlowOrder.push($scope.outgoingSequenceFlow[flowIndex].id);
}
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
// Cancel click handler
$scope.cancel = function() {
$scope.close();
};
// Close button handler
$scope.close = function() {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Execution listeners
*/
angular.module('flowableModeler').controller('FlowableSignalDefinitionsCtrl', ['$scope', '$modal', function ($scope, $modal) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/signal-definitions-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
//Need a separate controller for the modal window due to https://github.com/angular-ui/bootstrap/issues/259
// Will be fixed in a newer version of Angular UI
angular.module('flowableModeler').controller('FlowableSignalDefinitionsPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing signal definitions on scope
if ($scope.property.value !== undefined && $scope.property.value !== null && $scope.property.value.length > 0) {
if ($scope.property.value.constructor == String) {
$scope.signalDefinitions = JSON.parse($scope.property.value);
}
else {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.signalDefinitions = angular.copy($scope.property.value);
}
} else {
$scope.signalDefinitions = [];
}
// Array to contain selected signal definitions (yes - we only can select one, but ng-grid isn't smart enough)
$scope.selectedSignalDefinition = undefined;
$scope.translationsRetrieved = false;
$scope.labels = {};
var idPromise = $translate('PROPERTY.SIGNALDEFINITIONS.ID');
var namePromise = $translate('PROPERTY.SIGNALDEFINITIONS.NAME');
var scopePromise = $translate('PROPERTY.SIGNALDEFINITIONS.SCOPE');
$q.all([idPromise, namePromise, scopePromise]).then(function (results) {
$scope.labels.idLabel = results[0];
$scope.labels.nameLabel = results[1];
$scope.labels.scopeLabel = results[2];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.signalDefinitions,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [
{field: 'id', displayName: $scope.labels.idLabel},
{field: 'name', displayName: $scope.labels.nameLabel},
{field: 'scope', displayName: $scope.labels.scopeLabel}]
};
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedSignalDefinition = row.entity;
});
};
});
// Click handler for add button
$scope.addNewSignalDefinition = function () {
var newSignalDefinition = {id: '', name: '', scope: 'global'};
$scope.signalDefinitions.push(newSignalDefinition);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newSignalDefinition);
});
};
// Click handler for remove button
$scope.removeSignalDefinition = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.signalDefinitions.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.signalDefinitions.splice(index, 1);
if ($scope.signalDefinitions.length == 0) {
$scope.selectedSignalDefinition = undefined;
}
$timeout(function () {
if ($scope.signalDefinitions.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.signalDefinitions[0]);
}
});
}
};
$scope.scopeOptions = [{'value': 'global', 'translationId': 'PROPERTY.SIGNALDEFINITIONS.SCOPE-GLOBAL'},
{'value': 'processInstance', 'translationId': 'PROPERTY.SIGNALDEFINITIONS.SCOPE-PROCESSINSTANCE'}];
// Click handler for save button
$scope.save = function () {
if ($scope.signalDefinitions.length > 0) {
$scope.property.value = $scope.signalDefinitions;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
// Close button handler
$scope.close = function () {
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableSignalRefCtrl', [ '$scope', function($scope) {
// Find the parent shape on which the signal definitions are defined
var signalDefinitionsProperty = undefined;
var parent = $scope.selectedShape;
while (parent !== null && parent !== undefined && signalDefinitionsProperty === undefined) {
if (parent.properties && parent.properties.get('oryx-signaldefinitions')) {
signalDefinitionsProperty = parent.properties.get('oryx-signaldefinitions');
} else {
parent = parent.parent;
}
}
try {
signalDefinitionsProperty = JSON.parse(signalDefinitionsProperty);
if (typeof signalDefinitionsProperty == 'string') {
signalDefinitionsProperty = JSON.parse(signalDefinitionsProperty);
}
} catch (err) {
// Do nothing here, just to be sure we try-catch it
}
$scope.signalDefinitions = signalDefinitionsProperty;
$scope.signalChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Execution listeners
*/
angular.module('flowableModeler').controller('FlowableTransitionEventCtrl', [ '$scope', function($scope) {
if ($scope.property.value == undefined && $scope.property.value == null) {
$scope.property.value = 'complete';
}
$scope.transitionEventChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
angular.module('flowableModeler').controller('FlowableTriggerModeCtrl', [ '$scope', function($scope) {
if ($scope.property.value === undefined || $scope.property.value == null) {
$scope.property.value = 'default';
}
$scope.triggerModeChanged = function() {
$scope.updatePropertyInModel($scope.property);
};
}]);
\ No newline at end of file
<span ng-if="property.value.assignment.type != 'idm' && property.value.assignment.assignee">{{'PROPERTY.ASSIGNMENT.ASSIGNEE_DISPLAY' | translate:property.value.assignment }} </span>
<span ng-if="property.value.assignment.type != 'idm' && property.value.assignment.candidateUsers.length > 0">{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS_DISPLAY' | translate:property.value.assignment.candidateUsers}} </span>
<span ng-if="property.value.assignment.type != 'idm' && property.value.assignment.candidateGroups.length > 0">{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS_DISPLAY' | translate:property.value.assignment.candidateGroups}} </span>
<span ng-if="property.value.assignment.type == 'idm' && property.value.assignment.idm.assignee && property.value.assignment.idm.assignee.id">{{'PROPERTY.ASSIGNMENT.USER_IDM_DISPLAY' | translate:property.value.assignment.idm.assignee }} </span>
<span ng-if="property.value.assignment.type == 'idm' && property.value.assignment.idm.assignee && !property.value.assignment.idm.assignee.id">{{'PROPERTY.ASSIGNMENT.USER_IDM_EMAIL_DISPLAY' | translate:property.value.assignment.idm.assignee }} </span>
<span ng-if="property.value.assignment.type == 'idm' && property.value.assignment.idm.assigneeField && property.value.assignment.idm.assigneeField.id">{{'PROPERTY.ASSIGNMENT.USER_IDM_FIELD_DISPLAY' | translate:property.value.assignment.idm.assigneeField }} </span>
<span ng-if="property.value.assignment.type == 'idm' && property.value.assignment.idm.candidateUsers && property.value.assignment.idm.candidateUsers.length > 0 && (!property.value.assignment.idm.candidateUserFields || property.value.assignment.idm.candidateUserFields.length === 0)">{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS_DISPLAY' | translate:property.value.assignment.idm.candidateUsers}} </span>
<span ng-if="property.value.assignment.type == 'idm' && property.value.assignment.idm.candidateGroups && property.value.assignment.idm.candidateGroups.length > 0 && (!property.value.assignment.idm.candidateGroupFields || property.value.assignment.idm.candidateGroupFields.length === 0)">{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS_DISPLAY' | translate:property.value.assignment.idm.candidateGroups}} </span>
<span ng-if="property.value.assignment.type == 'idm' && property.value.assignment.idm.candidateUserFields && property.value.assignment.idm.candidateUserFields.length > 0 && (!property.value.assignment.idm.candidateUsers || property.value.assignment.idm.candidateUsers.length === 0)">{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS_DISPLAY' | translate:property.value.assignment.idm.candidateUserFields}} </span>
<span ng-if="property.value.assignment.type == 'idm' && property.value.assignment.idm.candidateGroupFields && property.value.assignment.idm.candidateGroupFields.length > 0 && (!property.value.assignment.idm.candidateGroups || property.value.assignment.idm.candidateGroups.length === 0)">{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS_DISPLAY' | translate:property.value.assignment.idm.candidateGroupFields}} </span>
<span ng-if="property.value.assignment.type == 'idm' && property.value.assignment.idm.candidateUserFields && property.value.assignment.idm.candidateUserFields.length > 0 && property.value.assignment.idm.candidateUsers && property.value.assignment.idm.candidateUsers.length > 0">{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS_DISPLAY' | translate:property.value.assignment.idm.candidateUserFields.concat(property.value.assignment.idm.candidateUsers)}} </span>
<span ng-if="property.value.assignment.type == 'idm' && property.value.assignment.idm.candidateGroupFields && property.value.assignment.idm.candidateGroupFields.length > 0 && property.value.assignment.idm.candidateGroups && property.value.assignment.idm.candidateGroups.length > 0">{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS_DISPLAY' | translate:property.value.assignment.idm.candidateGroupFields.concat(property.value.assignment.idm.candidateGroups)}} </span>
<span ng-if="property.value.assignment.type != 'idm' && !property.value.assignment.assignee && (!property.value.assignment.candidateUsers || property.value.assignment.candidateUsers.length == 0) && (!property.value.assignment.candidateGroups || property.value.assignment.candidateGroups.length == 0)" translate>PROPERTY.ASSIGNMENT.EMPTY</span>
<span ng-if="property.value.assignment.type == 'idm' && !property.value.assignment.idm.assignee && !property.value.assignment.idm.assigneeField && (!property.value.assignment.idm.candidateUsers || property.value.assignment.idm.candidateUsers.length == 0) && (!property.value.assignment.idm.candidateUserFields || property.value.assignment.idm.candidateUserFields.length == 0) && (!property.value.assignment.idm.candidateGroups || property.value.assignment.idm.candidateGroups.length == 0) && (!property.value.assignment.idm.candidateGroupFields || property.value.assignment.idm.candidateGroupFields.length == 0)" translate>PROPERTY.ASSIGNMENT.IDM_EMPTY</span>
\ No newline at end of file
<!-- Just need to instantiate the controller, and it will take care of showing the modal dialog -->
<span ng-controller="FlowableAssignmentCtrl">
</span>
\ No newline at end of file
<div ng-controller="FlowableBooleanPropertyCtrl">
<input type="checkbox" ng-model="property.value" ng-change="changeValue()"/>
</div>
\ No newline at end of file
<div ng-controller="FlowableCalledElementTypeCtrl">
<select ng-model="property.value" ng-change="calledElementTypeChanged ()">
<option>key</option>
<option>id</option>
</select>
</div>
\ No newline at end of file
<span ng-if="property.value.name">{{property.value.name}}</span>
<span ng-if="!property.value || !property.value.name" translate>PROPERTY.CASEREFERENCE.EMPTY</span>
<div class="modal" ng-controller="FlowableCaseReferencePopupCtrl">
<div class="modal-dialog modal-wide">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;</button>
<h2>
{{'PROPERTY.CASEREFERENCE.TITLE' | translate}}
<span ng-show="selectedCase != null"> - {{selectedCase.name}}</span>
<span ng-show="selectedCase == null"> - {{'PROPERTY.CASEREFERENCE.EMPTY' | translate}}</span>
</h2>
</div>
<div class="modal-body-with-overflow">
<div class="detail-group clearfix">
<div class="col-xs-12">
<div class="alert alert-error" ng-show="!state.loadingCases && state.caseError" translate>PROPERTY.CASEREFERENCE.ERROR.FORM</div>
</div>
</div>
<div class="detail-group clearfix">
<div class="col-xs-12 editor-item-picker">
<div ng-if="!state.loadingCases && !state.caseError" class="col-xs-4 editor-item-picker-component" ng-repeat="caseModel in caseModels" ng-class="{'selected' : caseModel.id == selectedCase.id}" ng-click="selectCase(caseModel, $event)">
<div class="controls">
<input type="checkbox" value="option1" ng-click="selectCase(caseModel, $event)" ng-checked="caseModel.id == selectedCase.id" />
</div>
<h4>{{caseModel.name}}</h4>
<img ng-src="{{getModelThumbnailUrl(caseModel.id)}}" />
</div>
<div ng-show="state.loadingCases">
<p class="loading" translate>PROPERTY.CASEREFERENCE.CASE.LOADING</p>
</div>
<div ng-show="!state.loadingCases && caseModels.length == 0">
<p translate>PROPERTY.CASEREFERENCE.CASE.EMPTY</p>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="close()" class="btn btn-primary" translate>GENERAL.ACTION.CANCEL</button>
<button ng-disabled="!selectedCase || state.caseError" ng-click="open()" class="btn btn-primary" translate>GENERAL.ACTION.OPEN</button>
<button ng-disabled="state.caseError" ng-click="save()" class="btn btn-primary" translate>GENERAL.ACTION.SAVE</button>
</div>
</div>
</div>
</div>
<span ng-if="property.value.expression.type != 'variables' && property.value.expression.staticValue">{{property.value.expression.staticValue|limitTo:20}}</span>
<span ng-if="property.value && !property.value.expression">{{property.value|limitTo:20}}</span>
<span ng-if="!property.value">{{'PROPERTY.SEQUENCEFLOW.CONDITION.NO-CONDITION-DISPLAY' | translate}}</span>
\ No newline at end of file
<div class="modal" ng-controller="FlowableConditionExpressionPopupCtrl">
<div class="modal-dialog modal-wide">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;</button>
<h2 translate>PROPERTY.SEQUENCEFLOW.CONDITION.TITLE</h2>
</div>
<div class="modal-body">
<div class="detail-group clearfix">
<div class="col-xs-12">
<label class="col-xs-3">{{'PROPERTY.SEQUENCEFLOW.CONDITION.STATIC' | translate}}</label>
<div class="col-xs-9">
<textarea class="form-control" ng-model="expression.staticValue" style="width:70%; height:100%; max-width: 100%; max-height: 100%; min-height: 50px"/>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="close()" class="btn btn-primary" translate>ACTION.CANCEL</button>
<button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button>
</div>
</div>
</div>
</div>
<!-- Just need to instantiate the controller, and it will take care of showing the modal dialog -->
<span ng-controller="FlowableConditionExpressionCtrl">
</span>
\ No newline at end of file
<span ng-if="property.value.items && property.value.items.length > 0">{{'PROPERTY.DATAPROPERTIES.VALUES' | translate:property.value.items}}</span>
<span ng-if="!property.value.items || property.value.items.length == 0" translate>PROPERTY.DATAPROPERTIES.EMPTY</span>
\ No newline at end of file
<div class="modal" ng-controller="FlowableDataPropertiesPopupCtrl">
<div class="modal-dialog modal-wide">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;</button>
<h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate}} "{{property.title | translate}}"</h2>
</div>
<div class="modal-body">
<div class="row row-no-gutter">
<div class="col-xs-6">
<div ng-if="translationsRetrieved" class="kis-listener-grid" ui-grid="gridOptions" ui-grid-selection></div>
<div class="pull-right">
<div class="btn-group">
<a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.UP' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="movePropertyUp()"><i class="glyphicon glyphicon-arrow-up"></i></a>
<a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.DOWN' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="movePropertyDown()"><i class="glyphicon glyphicon-arrow-down"></i></a>
</div>
<div class="btn-group">
<a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.ADD' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewProperty()"><i class="glyphicon glyphicon-plus"></i></a>
<a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.REMOVE' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeProperty()"><i class="glyphicon glyphicon-minus"></i></a>
</div>
</div>
</div>
<div class="col-xs-6">
<div ng-show="selectedProperty">
<div class="form-group">
<label for="idField">{{'PROPERTY.DATAPROPERTIES.ID' | translate}}</label>
<input id="idField" class="form-control" type="text" ng-model="selectedProperty.dataproperty_id" placeholder="{{'PROPERTY.DATAPROPERTIES.ID.PLACEHOLDER' | translate }}" />
</div>
<div class="form-group">
<label for="nameField">{{'PROPERTY.DATAPROPERTIES.NAME' | translate}}</label>
<input id="nameField" class="form-control" type="text" ng-model="selectedProperty.dataproperty_name" placeholder="{{'PROPERTY.DATAPROPERTIES.NAME.PLACEHOLDER' | translate }}" />
</div>
<div class="form-group">
<label for="typeField">{{'PROPERTY.DATAPROPERTIES.TYPE' | translate}}</label>
<select id="typeField" class="form-control" ng-model="selectedProperty.dataproperty_type" ng-change="propertyTypeChanged()">
<option selected>string</option>
<option>boolean</option>
<option>datetime</option>
<option>double</option>
<option>int</option>
<option>long</option>
</select>
</div>
<div class="form-group">
<label for="valueField">{{'PROPERTY.DATAPROPERTIES.VALUE' | translate}}</label>
<input id="valueField" class="form-control" type="text" ng-model="selectedProperty.dataproperty_value" placeholder="{{'PROPERTY.DATAPROPERTIES.VALUE.PLACEHOLDER' | translate }}" />
</div>
</div>
<div ng-show="!selectedProperty" class="muted no-property-selected" translate>PROPERTY.DATAPROPERTIES.EMPTY</div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button>
<button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button>
</div>
</div>
</div>
</div>
<!-- Just need to instantiate the controller, and it will take care of showing the modal dialog -->
<span ng-controller="FlowableDataPropertiesCtrl">
</span>
\ No newline at end of file
<span ng-if="property.value.name">{{property.value.name}}</span>
<span ng-if="!property.value || !property.value.name" translate>PROPERTY.DECISIONTABLEREFERENCE.EMPTY</span>
<div class="modal" ng-controller="FlowableDecisionTableReferencePopupCtrl">
<div class="modal-dialog modal-wide">
<div class="modal-content">
<div class="modal-header" ng-if="popup.state == 'decisionTableReference'">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;</button>
<h2>
{{'PROPERTY.DECISIONTABLEREFERENCE.TITLE' | translate}}
<span ng-show="selectedDecisionTable != null"> - {{selectedDecisionTable.name}}</span>
<span ng-show="selectedDecisionTable == null"> - {{'PROPERTY.DECISIONTABLEREFERENCE.EMPTY' | translate}}</span>
</h2>
</div>
<div class="modal-header" ng-if="popup.state == 'newDecisionTable'"><h2>{{'DECISION-TABLE.POPUP.CREATE-TITLE' | translate}}</h2></div>
<div class="modal-body-with-overflow" ng-if="popup.state == 'decisionTableReference'">
<div class="detail-group clearfix">
<div class="col-xs-12">
<div class="alert alert-error" ng-show="!state.loadingDecisionTables && state.decisionTableError" translate>PROPERTY.DECISIONTABLEREFERENCE.ERROR.FORM</div>
</div>
</div>
<div class="detail-group clearfix">
<div class="col-xs-12 editor-item-picker">
<div ng-if="!state.loadingDecisionTables && !state.decisionTableError" class="col-xs-4 editor-item-picker-component" ng-repeat="decisionTable in decisionTables" ng-class="{'selected' : decisionTable.decisionTableId == selectedDecisionTable.decisionTableId}" ng-click="selectDecisionTable(decisionTable, $event)">
<div class="controls">
<input type="checkbox" value="option1" ng-click="selectDecisionTable(decisionTable, $event)" ng-checked="decisionTable.id == selectedDecisionTable.id" />
</div>
<h4>{{decisionTable.name}}</h4>
<img ng-src="{{getModelThumbnailUrl(decisionTable.id)}}" />
</div>
<div ng-show="state.loadingDecisionTables">
<p class="loading" translate>PROPERTY.DECISIONTABLEREFERENCE.DECISIONTABLE.LOADING</p>
</div>
<div ng-show="!state.loadingDecisionTables && decisionTables.length == 0">
<p translate>PROPERTY.DECISIONTABLEREFERENCE.DECISIONTABLE.EMPTY</p>
</div>
</div>
</div>
</div>
<div class="modal-body" ng-if="popup.state == 'newDecisionTable'">
<p>{{'DECISION-TABLE.POPUP.CREATE-DESCRIPTION' | translate}}</p>
<div ng-if="model.errorMessage && model.errorMessage.length > 0" class="alert error" style="font-size: 14px; margin-top:20px">
<div class="popup-error" style="font-size: 14px">
<span class="glyphicon glyphicon-remove-circle"></span>
<span>{{model.errorMessage}}</span>
</div>
</div>
<div class="form-group">
<label for="newDecisionTableName">{{'DECISION-TABLE.NAME' | translate}}</label>
<input ng-disabled="model.loading" type="text" class="form-control"
id="newDecisionTableName" ng-model="model.decisionTable.name" custom-keys enter-pressed="ok()" auto-focus editor-input-check>
</div>
<div class="form-group">
<label for="newDecisionTableKey">{{'DECISION-TABLE.KEY' | translate}}</label>
<input ng-disabled="model.loading" type="text" class="form-control"
id="newDecisionTableKey" ng-model="model.decisionTable.key" editor-input-check>
</div>
<div class="form-group">
<label for="newDecisionTableDescription">{{'DECISION-TABLE.DESCRIPTION' | translate}}</label>
<textarea ng-disabled="model.loading" class="form-control" id="newDecisionTableDescription" rows="5" ng-model="model.decisionTable.description"></textarea>
</div>
</div>
<div class="modal-footer" ng-if="popup.state == 'decisionTableReference'">
<button ng-click="cancel()" class="btn btn-primary" translate>GENERAL.ACTION.CANCEL</button>
<button ng-disabled="state.decisionTableError" ng-click="newDecisionTable()" class="btn btn-primary" translate>GENERAL.ACTION.NEW-DECISION-TABLE</button>
<button ng-disabled="!selectedDecisionTable || state.decisionTableError" ng-click="open()" class="btn btn-primary" translate>GENERAL.ACTION.OPEN</button>
<button ng-disabled="state.decisionTableError" ng-click="save()" class="btn btn-primary" translate>GENERAL.ACTION.SAVE</button>
</div>
<div class="modal-footer" ng-if="popup.state == 'newDecisionTable'">
<button ng-click="cancel()" class="btn btn-primary" translate>GENERAL.ACTION.CANCEL</button>
<button ng-disabled="state.decisionTableError || model.decisionTable.name.length == 0 || model.decisionTable.key.length == 0" ng-click="createDecisionTable()" class="btn btn-primary" translate>GENERAL.ACTION.CREATE-DECISION-TABLE</button>
</div>
</div>
</div>
</div>
<span ng-if="!property.noValue">{{property.value|limitTo:20}}</span>
<span ng-if="!property.noValue && property.value != null && property.value.length > 20">...</span>
<span ng-if="property.noValue" translate>PROPERTY.EMPTY</span>
\ No newline at end of file
<span ng-if="property.value && property.value.duedate && property.value.duedate.field || property.value.duedate.field.taskDueDateField" translate>PROPERTY.DUEDATE.DEFINED</span>
<span ng-if="property.value && property.value.duedate && property.value.duedate.fixed" translate>PROPERTY.DUEDATE.DEFINED</span>
<span ng-if="property.value && property.value.duedateExpression">{{property.value.duedateExpression}}</span>
<span ng-if="property.value && property.value.length > 0 && !property.value.duedate && !property.value.duedateExpression">{{property.value}}</span>
<span ng-if="!property.value || property.value.length === 0" translate>PROPERTY.DUEDATE.EMPTY</span>
\ No newline at end of file
<div class="modal" ng-controller="BpmnEditorDueDatePopupCtrl">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;</button>
<h2 translate>PROPERTY.DUEDATE.TITLE</h2>
</div>
<div class="modal-body">
<div class="clearfix first">
<div class="col-xs-12">
<div class="col-xs-12">
<div class="btn-group span">
<button class="selection" data-toggle="dropdown" ng-options="option.id as (option.title | translate) for option in taskDueDateOptions"
bs-select ng-model="popup.selectedDueDateOption" ng-change="dueDateOptionChanged()" activiti-fix-dropdown-bug>
<i class="icon icon-caret-down"></i>
</button>
</div>
</div>
</div>
</div>
<div class="clearfix first" ng-if="popup.selectedDueDateOption === 'expression'" style="padding-top: 10px">
<div class="col-xs-12">
<div class="col-xs-4">
<label>{{'PROPERTY.DUEDATE.EXPRESSION-LABEL' | translate}}: </label>
</div>
<div class="col-xs-8">
<input id="expression" type="text" class="form-control" ng-model="popup.duedateExpression">
</div>
</div>
</div>
<div class="clearfix first" ng-if="popup.selectedDueDateOption === 'field'" style="padding-top: 10px">
<div class="col-xs-12">
<div class="col-xs-4">
<label>{{'PROCESS-BUILDER.FIELD.TIMER.DATE-FIELD' | translate}}: </label>
</div>
<div class="col-xs-8">
<div field-select="popup.duedate.field.taskDueDateField" editor-type="bpmn" all-steps="allSteps" step-id="selectedShape.resourceId" field-type-filter="['date']"></div>
</div>
</div>
</div>
<div class="clearfix first" ng-if="popup.selectedDueDateOption === 'field'" style="padding-top: 10px">
<div class="col-xs-12">
<div class="col-xs-4">
<label>{{'PROCESS-BUILDER.FIELD.DUEDATE.CALCULATION-TYPE' | translate}}: </label>
</div>
<div class="col-xs-8">
<div class="btn-group btn-group-justified">
<div class="btn-group">
<button type="button" class="btn btn-default" ng-click="setAddCalculationType()" ng-model="popup.duedate.field.taskDueDateCalculationType" ng-class="{'active' : (!popup.duedate.field.taskDueDateCalculationType || popup.duedate.field.taskDueDateCalculationType == 'add')}">{{'PROCESS-BUILDER.FIELD.DUEDATE.CALCULATION-OPTIONS.ADD' | translate}}</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default" ng-click="setSubtractCalculationType()" ng-model="popup.duedate.field.taskDueDateCalculationType" ng-class="{'active' : popup.duedate.field.taskDueDateCalculationType == 'subtract'}">{{'PROCESS-BUILDER.FIELD.DUEDATE.CALCULATION-OPTIONS.SUBTRACT' | translate}}</button>
</div>
</div>
</div>
</div>
</div>
<div class="clearfix first" ng-if="popup.selectedDueDateOption === 'field'" style="padding-top: 10px">
<div class="col-xs-12">
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.YEARS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.field.years">
</div>
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.MONTHS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.field.months">
</div>
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.DAYS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.field.days">
</div>
</div>
<div class="col-xs-12">
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.HOURS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.field.hours">
</div>
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.MINUTES' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.field.minutes">
</div>
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.SECONDS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.field.seconds">
</div>
</div>
</div>
<div class="clearfix first" ng-if="popup.selectedDueDateOption === 'static'" style="padding-top: 10px">
<div class="col-xs-12">
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.YEARS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.fixed.years">
</div>
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.MONTHS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.fixed.months">
</div>
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.DAYS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.fixed.days">
</div>
</div>
<div class="col-xs-12">
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.HOURS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.fixed.hours">
</div>
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.MINUTES' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.fixed.minutes">
</div>
<div class="col-xs-4">
{{'PROCESS-BUILDER.FIELD.TIMER.SECONDS' | translate}}:<input type="number" class="form-control" ng-model="popup.duedate.fixed.seconds">
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="close()" class="btn btn-primary" translate>ACTION.CANCEL</button>
<button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button>
</div>
</div>
</div>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment