Browse Source

modeller集成

wangwei 7 years ago
parent
commit
d5f76cb142
53 changed files with 865 additions and 6326 deletions
  1. 30 96
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/pom.xml
  2. 266 0
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/java/org/hswebframework/web/workflow/flowable/modeler/FlowableDeploymentController.java
  3. 140 0
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/modeler.html
  4. 0 157
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/404.html
  5. 0 9
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/browserconfig.xml
  6. 0 3
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/.gitignore
  7. 0 153
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/Gruntfile.js
  8. 0 824
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/bpmn-draw.js
  9. 0 303
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/bpmn-icons.js
  10. 0 24
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/displaymodel.css
  11. 0 19
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/displaymodel.html
  12. 0 317
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/displaymodel.js
  13. 0 2
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/jquery.qtip.min.css
  14. 0 5
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/jquery.qtip.min.js
  15. 0 37
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/package.json
  16. 0 19
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/flowable-header-custom.js
  17. 0 39
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/flowable-toolbar-custom-actions.js
  18. 0 504
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-assignment-controller.js
  19. 0 80
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-collapsed-subprocess-controller.js
  20. 0 59
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-condition-expression-controller.js
  21. 0 12
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-custom-controllers.js
  22. 0 288
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-decisiontable-reference-controller.js
  23. 0 126
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-duedate-controller.js
  24. 0 263
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-event-listeners-controller.js
  25. 0 358
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-execution-listeners-controller.js
  26. 0 206
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-fields-controller.js
  27. 0 327
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-form-properties-controller.js
  28. 0 261
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-form-reference-controller.js
  29. 0 179
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-in-parameters-controller.js
  30. 0 41
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-message-scope-controller.js
  31. 0 28
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-multiinstance-controller.js
  32. 0 28
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-ordering-controller.js
  33. 0 176
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-out-parameters-controller.js
  34. 0 42
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-signal-scope-controller.js
  35. 0 356
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-task-listeners-controller.js
  36. 0 15
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/assignment-display-template.html
  37. 0 268
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/assignment-popup.html
  38. 0 3
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/condition-expression-display-template.html
  39. 0 74
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/decisiontable-reference-popup.html
  40. 0 2
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/decisiontable-reference-write-template.html
  41. 0 6
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/duedate-display-template.html
  42. 0 120
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/duedate-popup.html
  43. 0 5
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/errorgrid-critical.html
  44. 0 119
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/event-listeners-popup.html
  45. 0 4
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/execution-listeners-write-template.html
  46. 0 58
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/fields-popup.html
  47. 1 0
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/test/resources/application.yml
  48. 76 0
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/test/resources/processes/SimpleProcess.bpmn20.xml
  49. 0 11
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/pom.xml
  50. 289 289
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/controller/BpmDeploymentController.java
  51. 23 4
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/service/BpmActivityService.java
  52. 38 6
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/service/imp/BpmActivityServiceImp.java
  53. 2 1
      hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/test/java/org/hswebframework/web/workflow/flowable/ControllerTest.java

+ 30 - 96
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/pom.xml

@@ -12,79 +12,26 @@
     <artifactId>hsweb-system-workflow-flowable-modeler</artifactId>
 
     <dependencies>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-authorization-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-commons-controller</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
         <dependency>
             <groupId>org.hswebframework.web</groupId>
             <artifactId>hsweb-system-workflow-flowable</artifactId>
             <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>commons-io</artifactId>
+                    <groupId>commons-io</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
-
-        <!--<dependency>-->
-            <!--<groupId>org.flowable</groupId>-->
-            <!--<artifactId>flowable-ui-modeler-conf</artifactId>-->
-            <!--<version>${flowable.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.flowable</groupId>-->
-            <!--<artifactId>flowable-ui-modeler-rest</artifactId>-->
-            <!--<version>${flowable.version}</version>-->
-            <!--<exclusions>-->
-                <!--&lt;!&ndash;<exclusion>&ndash;&gt;-->
-                    <!--&lt;!&ndash;<groupId>org.flowable</groupId>&ndash;&gt;-->
-                    <!--&lt;!&ndash;<artifactId>flowable-ui-modeler-logic</artifactId>&ndash;&gt;-->
-                <!--&lt;!&ndash;</exclusion>&ndash;&gt;-->
-                <!--<exclusion>-->
-                    <!--<groupId>org.mybatis</groupId>-->
-                    <!--<artifactId>mybatis</artifactId>-->
-                <!--</exclusion>-->
-                <!--<exclusion>-->
-                    <!--<groupId>org.mybatis</groupId>-->
-                    <!--<artifactId>mybatis-spring</artifactId>-->
-                <!--</exclusion>-->
-                <!--<exclusion>-->
-                    <!--<groupId>org.springframework.security</groupId>-->
-                    <!--<artifactId>spring-security-core</artifactId>-->
-                <!--</exclusion>-->
-                <!--<exclusion>-->
-                    <!--<groupId>org.springframework.security</groupId>-->
-                    <!--<artifactId>spring-security-config</artifactId>-->
-                <!--</exclusion>-->
-                <!--<exclusion>-->
-                    <!--<groupId>org.springframework.security</groupId>-->
-                    <!--<artifactId>spring-security-crypto</artifactId>-->
-                <!--</exclusion>-->
-                <!--<exclusion>-->
-                    <!--<groupId>org.springframework.security</groupId>-->
-                    <!--<artifactId>spring-security-web</artifactId>-->
-                <!--</exclusion>-->
-            <!--</exclusions>-->
-        <!--</dependency>-->
-
-        <!--<dependency>-->
-            <!--<groupId>org.hswebframework.web</groupId>-->
-            <!--<artifactId>hsweb-spring-boot-starter</artifactId>-->
-            <!--<version>${project.version}</version>-->
-        <!--</dependency>-->
-
         <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-commons-dao-mybatis</artifactId>
-            <version>${project.version}</version>
+            <groupId>org.flowable</groupId>
+            <artifactId>flowable-spring-boot-starter-basic</artifactId>
+            <version>${flowable.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.flowable</groupId>
-            <artifactId>flowable-bpmn-model</artifactId>
+            <artifactId>flowable-json-converter</artifactId>
             <version>${flowable.version}</version>
         </dependency>
         <dependency>
@@ -94,41 +41,28 @@
         </dependency>
         <dependency>
             <groupId>org.flowable</groupId>
-            <artifactId>flowable-json-converter</artifactId>
+            <artifactId>flowable-explorer</artifactId>
             <version>${flowable.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>vaadin</artifactId>
+                    <groupId>com.vaadin</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>dcharts-widget</artifactId>
+                    <groupId>org.vaadin.addons</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>slf4j-log4j12</artifactId>
+                    <groupId>org.slf4j</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.flowable</groupId>
-            <artifactId>flowable-bpmn-layout</artifactId>
+            <artifactId>flowable-simple-workflow</artifactId>
             <version>${flowable.version}</version>
         </dependency>
-        <!--<dependency>-->
-            <!--<groupId>org.flowable</groupId>-->
-            <!--<artifactId>flowable-form-model</artifactId>-->
-            <!--<version>${flowable.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.flowable</groupId>-->
-            <!--<artifactId>flowable-form-json-converter</artifactId>-->
-            <!--<version>${flowable.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.flowable</groupId>-->
-            <!--<artifactId>flowable-dmn-model</artifactId>-->
-            <!--<version>${flowable.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.flowable</groupId>-->
-            <!--<artifactId>flowable-dmn-xml-converter</artifactId>-->
-            <!--<version>${flowable.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.flowable</groupId>-->
-            <!--<artifactId>flowable-dmn-json-converter</artifactId>-->
-            <!--<version>${flowable.version}</version>-->
-        <!--</dependency>-->
-
-
         <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
@@ -140,15 +74,15 @@
             <version>1.0.26</version>
             <scope>test</scope>
         </dependency>
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-logging</artifactId>
-            <scope>test</scope>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>3.0-alpha-1</version>
         </dependency>
     </dependencies>
 

+ 266 - 0
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/java/org/hswebframework/web/workflow/flowable/modeler/FlowableDeploymentController.java

@@ -0,0 +1,266 @@
+package org.hswebframework.web.workflow.flowable.modeler;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.activiti.bpmn.converter.BpmnXMLConverter;
+import org.activiti.bpmn.model.BpmnModel;
+import org.activiti.editor.constants.ModelDataJsonConstants;
+import org.activiti.editor.language.json.converter.BpmnJsonConverter;
+import org.activiti.engine.history.HistoricProcessInstance;
+import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
+import org.activiti.engine.repository.DeploymentBuilder;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.io.FilenameUtils;
+import org.hsweb.ezorm.core.PropertyWrapper;
+import org.hsweb.ezorm.core.SimplePropertyWrapper;
+import org.hsweb.ezorm.core.param.TermType;
+import org.hswebframework.web.commons.entity.PagerResult;
+import org.hswebframework.web.commons.entity.param.QueryParamEntity;
+import org.hswebframework.web.controller.message.ResponseMessage;
+import org.hswebframework.web.workflow.flowable.service.BpmActivityService;
+import org.hswebframework.web.workflow.flowable.service.BpmProcessService;
+import org.hswebframework.web.workflow.flowable.service.BpmTaskService;
+import org.hswebframework.web.workflow.flowable.utils.FlowableAbstract;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.List;
+import java.util.zip.ZipInputStream;
+
+/**
+ * @Author wangwei
+ * @Date 2017/8/10.
+ */
+@RestController
+@RequestMapping("/workflow/procDef")
+public class FlowableDeploymentController extends FlowableAbstract {
+
+    private final static String MODEL_ID = "modelId";
+    private final static String MODEL_NAME = "name";
+    private final static String MODEL_REVISION = "revision";
+    private final static String MODEL_DESCRIPTION = "description";
+    private final static String MODEL_KEY = "key";
+
+    @Autowired
+    BpmTaskService bpmTaskService;
+    @Autowired
+    BpmProcessService bpmProcessService;
+    @Autowired
+    BpmActivityService bpmActivityService;
+
+    /**
+     * 流程定义列表
+     */
+    @GetMapping("/list")
+    public ResponseMessage<PagerResult<ProcessDefinition>> processList(QueryParamEntity param) {
+        ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
+        param.getTerms().forEach((term) -> {
+
+            PropertyWrapper valueWrapper = new SimplePropertyWrapper(term.getValue());
+            String stringValue = valueWrapper.toString();
+            switch (term.getColumn()) {
+                case "name":
+                    if (term.getTermType().equals(TermType.like)) {
+                        processDefinitionQuery.processDefinitionNameLike(stringValue);
+                    } else
+                        processDefinitionQuery.processDefinitionName(stringValue);
+                    break;
+                case "key":
+                    if (term.getTermType().equals(TermType.like)) {
+                        processDefinitionQuery.processDefinitionKeyLike(stringValue);
+                    } else
+                        processDefinitionQuery.processDefinitionKey(stringValue);
+                    break;
+                case "category":
+                    if (term.getTermType().equals(TermType.like))
+                        processDefinitionQuery.processDefinitionCategoryLike(stringValue);
+                    else
+                        processDefinitionQuery.processDefinitionCategory(stringValue);
+                    break;
+                case "deploymentId":
+                    processDefinitionQuery.deploymentId(stringValue);
+                    break;
+            }
+        });
+        int total = (int) processDefinitionQuery.count();
+        param.rePaging(total);
+        List<ProcessDefinition> models = processDefinitionQuery.listPage(param.getPageIndex(), param.getPageSize() * (param.getPageIndex() + 1));
+        return ResponseMessage.ok(new PagerResult<>(total, models))
+                .exclude(ProcessDefinitionEntity.class,"identityLinks");
+    }
+
+    /**
+     * 部署流程资源
+     * 加载ZIP文件中的流程
+     */
+    @RequestMapping(value="/deploy")
+    public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {
+
+        // 获取上传的文件名
+        String fileName = file.getOriginalFilename();
+
+        try {
+            // 得到输入流(字节流)对象
+            InputStream fileInputStream = file.getInputStream();
+
+            // 文件的扩展名
+            String extension = FilenameUtils.getExtension(fileName);
+
+            // zip或者bar类型的文件用ZipInputStream方式部署
+            DeploymentBuilder deployment = repositoryService.createDeployment();
+            if (extension.equals("zip") || extension.equals("bar")) {
+                ZipInputStream zip = new ZipInputStream(fileInputStream);
+                deployment.addZipInputStream(zip);
+            } else {
+                // 其他类型的文件直接部署
+                deployment.addInputStream(fileName, fileInputStream);
+            }
+            deployment.deploy();
+        } catch (Exception e) {
+//            logger.error("部署流程错误,获取文件流失败");
+        }
+
+        return "redirect:list";
+    }
+
+    /**
+     * 读取流程资源
+     *
+     * @param processDefinitionId 流程定义ID
+     * @param resourceName        资源名称
+     */
+    @GetMapping(value = "/read-resource")
+    public void readResource(@RequestParam("pdid") String processDefinitionId, @RequestParam("resourceName") String resourceName, HttpServletResponse response)
+            throws Exception {
+        ProcessDefinitionQuery pdq = repositoryService.createProcessDefinitionQuery();
+        ProcessDefinition pd = pdq.processDefinitionId(processDefinitionId).singleResult();
+
+        // 通过接口读取
+        InputStream resourceAsStream = repositoryService.getResourceAsStream(pd.getDeploymentId(), resourceName);
+
+        // 输出资源内容到相应对象
+        byte[] b = new byte[1024];
+        int len = -1;
+        while ((len = resourceAsStream.read(b, 0, 1024)) != -1) {
+            response.getOutputStream().write(b, 0, len);
+        }
+    }
+
+    /***
+     * 流程定义转换Model
+     * @param processDefinitionId
+     * @return
+     * @throws UnsupportedEncodingException
+     * @throws XMLStreamException
+     */
+    @RequestMapping(value = "/convert-to-model/{processDefinitionId}")
+    public ResponseMessage<String> convertToModel(@PathVariable("processDefinitionId") String processDefinitionId)
+            throws UnsupportedEncodingException, XMLStreamException {
+        ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+                .processDefinitionId(processDefinitionId).singleResult();
+        InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(),
+                processDefinition.getResourceName());
+        XMLInputFactory xif = XMLInputFactory.newInstance();
+        InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8");
+        XMLStreamReader xtr = xif.createXMLStreamReader(in);
+        BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
+
+        BpmnJsonConverter converter = new BpmnJsonConverter();
+        com.fasterxml.jackson.databind.node.ObjectNode modelNode = converter.convertToJson(bpmnModel);
+        org.activiti.engine.repository.Model modelData = repositoryService.newModel();
+        modelData.setKey(processDefinition.getKey());
+        modelData.setName(processDefinition.getResourceName().substring(0,processDefinition.getResourceName().indexOf(".")));
+        modelData.setCategory(processDefinition.getDeploymentId());
+
+        ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
+        modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, processDefinition.getName());
+        modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1);
+        modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, processDefinition.getDescription());
+        modelData.setMetaInfo(modelObjectNode.toString());
+
+        repositoryService.saveModel(modelData);
+
+        repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8"));
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put(MODEL_ID,modelData.getId());
+        return ResponseMessage.ok(jsonObject.toJSONString());
+    }
+
+    /**
+     * 删除部署的流程,如果流程下有正在运行的流程实例则报错
+     *
+     * @param deploymentId 流程部署ID
+     */
+    @RequestMapping(value = "/delete-deployment")
+    public String deleteProcessDefinition(@RequestParam("deploymentId") String deploymentId) {
+        repositoryService.deleteDeployment(deploymentId);
+        return "redirect:index";
+    }
+
+    /**
+     * 删除部署的流程,级联删除流程实例
+     *
+     * @param deploymentId 流程部署ID
+     */
+    @RequestMapping(value = "/delete-deploy")
+    public String deleteProcess(@RequestParam("deploymentId") String deploymentId) {
+        repositoryService.deleteDeployment(deploymentId, true);
+        return "redirect:index";
+    }
+
+    /**
+     * 查看当前节点流程图
+     * @param processInstanceId
+     * @return  当前节点
+     * window.open('/showImage?processInstanceId=' + processInstanceId, 'newwindow', 'height=500, width=1000, top=100,left=200, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
+     *      <div>
+    <#if message??>
+    <h1>${message!}</h1>
+    <#else>
+    <img src="${application.getContextPath()}/workflow/document/alldoc/findPic/${procDefId!}">
+    <!-- 给执行的节点加框 -->
+    <div style="position:absolute; border:2px solid red;left:${activity.x+6 }px;
+    top:${activity.y+6 }px;width:${activity.width }px;height:${activity.height }px;"></div>
+    </#if>
+    </div>
+     */
+    @GetMapping("/showImage/{processInstanceId}")
+    public Object showImage(@PathVariable String processInstanceId){
+        JSONObject jsonObject = new JSONObject();
+        HistoricProcessInstance processInstance = bpmTaskService.selectHisProInst(processInstanceId);
+        if(processInstance!=null){
+            ActivityImpl activity = bpmActivityService.getActivityByProcInstId(processInstance.getProcessDefinitionId(),processInstance.getId());
+            jsonObject.put("activity",activity);
+            jsonObject.put("procDefId",processInstance.getProcessDefinitionId());
+        }else{
+            jsonObject.put("message","获取流程图失败");
+//            logger.debug("获取流程节点,processInstanceId:"+processInstanceId);
+        }
+        return jsonObject;
+    }
+
+    @GetMapping("/findPic/{procDefId}")
+    public void findPic(@PathVariable String procDefId,HttpServletResponse response){
+        try{
+            InputStream inputStream = bpmProcessService.findProcessPic(procDefId);
+            byte[] b = new byte[1024];
+            int len = 0;
+            while ((len = inputStream.read(b,0,1024))!=-1){
+                response.getOutputStream().write(b, 0, len);
+            }
+        }catch (Exception e){
+//            logger.debug("获取流程图失败,procDefId:"+procDefId);
+        }
+    }
+}

+ 140 - 0
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/modeler.html

@@ -0,0 +1,140 @@
+<!doctype html>
+<!--[if lt IE 7]>
+<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>
+<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>
+<html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!-->
+<html class="no-js"> <!--<![endif]-->
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <title>Flowable 工作流模型设计器</title>
+    <meta name="description" content="">
+    <meta name="viewport"
+          content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width">
+    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
+
+    <link rel="Stylesheet" media="screen" href="editor-app/libs/ng-grid-2.0.7.min.css" type="text/css"/>
+    <link rel="stylesheet" href="editor-app/libs/bootstrap_3.1.1/css/bootstrap.min.css"/>
+
+    <link rel="Stylesheet" media="screen" href="editor-app/editor/css/editor.css" type="text/css"/>
+    <link rel="stylesheet" href="editor-app/css/style.css" type="text/css"/>
+
+	<link rel="stylesheet" href="editor-app/css/style-common.css">
+    <link rel="stylesheet" href="editor-app/css/style-editor.css">
+
+</head>
+<body>
+
+	<div class="navbar navbar-fixed-top navbar-inverse" role="navigation" id="main-header">
+	    <div class="navbar-header">
+            <a href="" ng-click="backToLanding()" class="navbar-brand"
+               title="{{'GENERAL.MAIN-TITLE' | translate}}"><span
+                    class="sr-only">{{'GENERAL.MAIN-TITLE' | translate}}</span></a>
+        </div>
+	</div>
+	
+	<!--[if lt IE 9]>
+	<div class="unsupported-browser">
+	    <p class="alert error">You are using an unsupported browser. Please upgrade your browser in order to use the
+	        editor.</p>
+	</div>
+	<![endif]-->
+	
+	<div class="alert-wrapper" ng-cloak>
+	    <div class="alert fadein {{alerts.current.type}}" ng-show="alerts.current" ng-click="dismissAlert()">
+	        <i class="glyphicon"
+	           ng-class="{'glyphicon-ok': alerts.current.type == 'info', 'glyphicon-remove': alerts.current.type == 'error'}"></i>
+	        <span>{{alerts.current.message}}</span>
+	
+	        <div class="pull-right" ng-show="alerts.queue.length > 0">
+	            <span class="badge">{{alerts.queue.length + 1}}</span>
+	        </div>
+	    </div>
+	</div>
+	
+	<div id="main" class="wrapper full clearfix" ng-style="{height: window.height + 'px'}" ng-app="activitiModeler" ng-include="'editor-app/editor.html'">
+	</div>
+
+	<!--[if lt IE 9]>
+    <script src="editor-app/libs/es5-shim-15.3.4.5/es5-shim.js"></script>
+    <script src="editor-app/libs/json3_3.2.6/lib/json3.min.js"></script>
+    <![endif]-->
+	
+	<script src="editor-app/libs/jquery_1.11.0/jquery.min.js"></script>
+	<script src="editor-app/libs/jquery-ui-1.10.3.custom.min.js"></script>
+	
+	<script src="editor-app/libs/angular_1.2.13/angular.min.js"></script>
+	<script src="editor-app/libs/angular_1.2.13/angular-animate.min.js"></script>
+	<script src="editor-app/libs/bootstrap_3.1.1/js/bootstrap.min.js"></script>
+	<script src="editor-app/libs/angular-resource_1.2.13/angular-resource.min.js"></script>
+	<script src="editor-app/libs/angular-cookies_1.2.13/angular-cookies.min.js"></script>
+	<script src="editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.min.js"></script>
+	<script src="editor-app/libs/angular-route_1.2.13/angular-route.min.js"></script>
+	<script src="editor-app/libs/angular-translate_2.4.2/angular-translate.min.js"></script>
+	<script src="editor-app/libs/angular-translate-storage-cookie/angular-translate-storage-cookie.js"></script>
+	<script src="editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.js"></script>
+	<script src="editor-app/libs/angular-strap_2.0.5/angular-strap.min.js"></script>
+	<script src="editor-app/libs/angular-strap_2.0.5/angular-strap.tpl.min.js"></script>
+	<script src="editor-app/libs/momentjs_2.5.1/momentjs.min.js"></script>
+	
+	<script src="editor-app/libs/ui-utils.min-0.0.4.js" type="text/javascript"></script>
+	<script src="editor-app/libs/ng-grid-2.0.7-min.js" type="text/javascript"></script>
+	<script src="editor-app/libs/angular-dragdrop.min-1.0.3.js" type="text/javascript"></script>
+	<script src="editor-app/libs/mousetrap-1.4.5.min.js" type="text/javascript"></script>
+	<script src="editor-app/libs/jquery.autogrow-textarea.js" type="text/javascript"></script>
+	
+	<script src="editor-app/libs/prototype-1.5.1.js" type="text/javascript"></script>
+	<script src="editor-app/libs/path_parser.js" type="text/javascript"></script>
+	
+	<script src="editor-app/libs/angular-scroll_0.5.7/angular-scroll.min.js" type="text/javascript"></script>
+	
+	<!-- Configuration -->
+	<script src="editor-app/app-cfg.js?v=1"></script>
+	<script src="editor-app/editor-config.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/url-config.js" type="text/javascript"></script>
+	
+	<script src="editor-app/editor/i18n/translation_en_us.js" type="text/javascript"></script>
+	<script src="editor-app/editor/i18n/translation_signavio_en_us.js" type="text/javascript"></script>
+	<script src="editor-app/editor/oryx.debug.js" type="text/javascript"></script>
+	
+	<script src="editor-app/app.js"></script>
+	
+	<script src="editor-app/eventbus.js" type="text/javascript"></script>
+	
+	<script src="editor-app/editor-controller.js" type="text/javascript"></script>
+	<script src="editor-app/stencil-controller.js" type="text/javascript"></script>
+	<script src="editor-app/toolbar-controller.js" type="text/javascript"></script>
+	<script src="editor-app/header-controller.js" type="text/javascript"></script>
+	<script src="editor-app/select-shape-controller.js" type="text/javascript"></script>
+	
+	<script src="editor-app/editor-utils.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/toolbar-default-actions.js" type="text/javascript"></script>
+	
+	<script src="editor-app/configuration/properties-default-controllers.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-execution-listeners-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-event-listeners-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-assignment-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-fields-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-form-properties-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-in-parameters-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-multiinstance-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-out-parameters-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-task-listeners-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-sequenceflow-order-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-condition-expression-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-signal-definitions-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-signal-scope-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-message-definitions-controller.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-message-scope-controller.js" type="text/javascript"></script>
+	
+	<script src="editor-app/configuration/toolbar.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/toolbar-custom-actions.js" type="text/javascript"></script>
+	
+	<script src="editor-app/configuration/properties.js" type="text/javascript"></script>
+	<script src="editor-app/configuration/properties-custom-controllers.js" type="text/javascript"></script>
+
+</body>
+</html>

+ 0 - 157
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/404.html

@@ -1,157 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <title>Page Not Found :(</title>
-    <style>
-      ::-moz-selection {
-        background: #b3d4fc;
-        text-shadow: none;
-      }
-
-      ::selection {
-        background: #b3d4fc;
-        text-shadow: none;
-      }
-
-      html {
-        padding: 30px 10px;
-        font-size: 20px;
-        line-height: 1.4;
-        color: #737373;
-        background: #f0f0f0;
-        -webkit-text-size-adjust: 100%;
-        -ms-text-size-adjust: 100%;
-      }
-
-      html,
-      input {
-        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-      }
-
-      body {
-        max-width: 500px;
-        _width: 500px;
-        padding: 30px 20px 50px;
-        border: 1px solid #b3b3b3;
-        border-radius: 4px;
-        margin: 0 auto;
-        box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
-        background: #fcfcfc;
-      }
-
-      h1 {
-        margin: 0 10px;
-        font-size: 50px;
-        text-align: center;
-      }
-
-      h1 span {
-        color: #bbb;
-      }
-
-      h3 {
-        margin: 1.5em 0 0.5em;
-      }
-
-      p {
-        margin: 1em 0;
-      }
-
-      ul {
-        padding: 0 0 0 40px;
-        margin: 1em 0;
-      }
-
-      .container {
-        max-width: 380px;
-        _width: 380px;
-        margin: 0 auto;
-      }
-
-      /* google search */
-
-      #goog-fixurl ul {
-        list-style: none;
-        padding: 0;
-        margin: 0;
-      }
-
-      #goog-fixurl form {
-        margin: 0;
-      }
-
-      #goog-wm-qt,
-      #goog-wm-sb {
-        border: 1px solid #bbb;
-        font-size: 16px;
-        line-height: normal;
-        vertical-align: top;
-        color: #444;
-        border-radius: 2px;
-      }
-
-      #goog-wm-qt {
-        width: 220px;
-        height: 20px;
-        padding: 5px;
-        margin: 5px 10px 0 0;
-        box-shadow: inset 0 1px 1px #ccc;
-      }
-
-      #goog-wm-sb {
-        display: inline-block;
-        height: 32px;
-        padding: 0 10px;
-        margin: 5px 0 0;
-        white-space: nowrap;
-        cursor: pointer;
-        background-color: #f5f5f5;
-        background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1);
-        background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1);
-        background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1);
-        background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1);
-        -webkit-appearance: none;
-        -moz-appearance: none;
-        appearance: none;
-        *overflow: visible;
-        *display: inline;
-        *zoom: 1;
-      }
-
-      #goog-wm-sb:hover,
-      #goog-wm-sb:focus {
-        border-color: #aaa;
-        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
-        background-color: #f8f8f8;
-      }
-
-      #goog-wm-qt:hover,
-      #goog-wm-qt:focus {
-        border-color: #105cb6;
-        outline: 0;
-        color: #222;
-      }
-
-      input::-moz-focus-inner {
-        padding: 0;
-        border: 0;
-      }
-    </style>
-  </head>
-  <body>
-    <div class="container">
-      <h1>Not found <span>:(</span></h1>
-      <p>Sorry, but the page you were trying to view does not exist.</p>
-      <p>It looks like this was the result of either:</p>
-      <ul>
-        <li>a mistyped address</li>
-        <li>an out-of-date link</li>
-      </ul>
-      <script>
-        var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host;
-      </script>
-      <script src="//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
-    </div>
-  </body>
-</html>

+ 0 - 9
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/browserconfig.xml

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<browserconfig>
-  <msapplication>
-    <tile>
-      <square150x150logo src="images/mstile-150x150.png?v=Om5N75Y123"/>
-      <TileColor>#da532c</TileColor>
-    </tile>
-  </msapplication>
-</browserconfig>

+ 0 - 3
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/.gitignore

@@ -1,3 +0,0 @@
-/dist
-/node_modules
-/displaymodel_temp.html

+ 0 - 153
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/Gruntfile.js

@@ -1,153 +0,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';
-
-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'
-    ]);
-
-};

+ 0 - 824
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/bpmn-draw.js

@@ -1,824 +0,0 @@
-/* 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.
- */
-function _bpmnGetColor(element, defaultColor) 
-{
-    var strokeColor;
-    if(element.current) {
-        strokeColor = CURRENT_COLOR;
-    } else if(element.completed) {
-        strokeColor = COMPLETED_COLOR;
-    } else {
-        strokeColor = defaultColor;
-    }
-    return strokeColor;
-}
-
-function _drawPool(pool)
-{
-	var rect = paper.rect(pool.x, pool.y, pool.width, pool.height);
-
-	rect.attr({"stroke-width": 1,
-		"stroke": "#000000",
-		"fill": "white"
- 	});
-	
-	if (pool.name)
-	{
-		var poolName = paper.text(pool.x + 14, pool.y + (pool.height / 2), pool.name).attr({
-	        "text-anchor" : "middle",
-	        "font-family" : "Arial",
-	        "font-size" : "12",
-	        "fill" : "#000000"
-	  	});
-		
-		poolName.transform("r270");
-	}
-	
-	if (pool.lanes)
-	{
-		for (var i = 0; i < pool.lanes.length; i++)
-		{
-			var lane = pool.lanes[i];
-			_drawLane(lane);
-		}
-	}
-}
-
-function _drawLane(lane)
-{
-	var rect = paper.rect(lane.x, lane.y, lane.width, lane.height);
-
-	rect.attr({"stroke-width": 1,
-		"stroke": "#000000",
-		"fill": "white"
- 	});
-	
-	if (lane.name)
-	{
-		var laneName = paper.text(lane.x + 10, lane.y + (lane.height / 2), lane.name).attr({
-	        "text-anchor" : "middle",
-	        "font-family" : "Arial",
-	        "font-size" : "12",
-	        "fill" : "#000000"
-	  	});
-		
-		laneName.transform("r270");
-	}
-}
-
-function _drawSubProcess(element)
-{
-	var rect = paper.rect(element.x, element.y, element.width, element.height, 4);
-
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-	
-	rect.attr({"stroke-width": 1,
-		"stroke": strokeColor,
-		"fill": "white"
- 	});
-}
-
-function _drawTransaction(element)
-{
-	var rect = paper.rect(element.x, element.y, element.width, element.height, 4);
-
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-	
-	rect.attr({"stroke-width": 1,
-		"stroke": strokeColor,
-		"fill": "white"
- 	});
-	
-	var borderRect = paper.rect(element.x + 2, element.y + 2, element.width - 4, element.height -4, 4);
-	
-	borderRect.attr({"stroke-width": 1,
-		"stroke": "black",
-		"fill": "none"
- 	});
-}
-
-function _drawEventSubProcess(element)
-{
-	var rect = paper.rect(element.x, element.y, element.width, element.height, 4);
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-	
-	rect.attr({"stroke-width": 1,
-		"stroke": strokeColor,
-		"stroke-dasharray": ".",
-		"fill": "white"
- 	});
-}
-
-function _drawAdhocSubProcess(element)
-{
-	var rect = paper.rect(element.x, element.y, element.width, element.height, 4);
-
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-	
-	rect.attr({"stroke-width": 1,
-		"stroke": strokeColor,
-		"fill": "white"
- 	});
- 	
- 	paper.text(element.x + (element.width / 2), element.y + element.height - 8).attr({
-        "text-anchor" : "middle",
-        "font-family" : "Arial",
-        "font-size" : 20,
-        "text" : "~",
-        "fill" : "#373e48"
-  	});
-}
-
-function _drawStartEvent(element)
-{
-	var startEvent = _drawEvent(element, NORMAL_STROKE, 15);
-	startEvent.click(function() {
-		_zoom(true);
-	});
-	_addHoverLogic(element, "circle", MAIN_STROKE_COLOR);
-}
-
-function _drawEndEvent(element)
-{
-	var endEvent = _drawEvent(element, ENDEVENT_STROKE, 14);
-	endEvent.click(function() {
-		_zoom(false);
-	});
-	_addHoverLogic(element, "circle", MAIN_STROKE_COLOR);
-}
-
-function _drawEvent(element, strokeWidth, radius)
-{
-	var x = element.x + (element.width / 2);
-	var y = element.y + (element.height / 2);
-
-	var circle = paper.circle(x, y, radius);
-
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-
-    // Fill
-    var eventFillColor = _determineCustomFillColor(element, "#ffffff");
-
-    // Opacity
-    var eventOpacity = 1.0;
-    if (customActivityBackgroundOpacity) {
-        eventOpacity = customActivityBackgroundOpacity;
-    }
-    
-	if (element.interrupting === undefined || element.interrupting) {
-		circle.attr({
-		    "stroke-width": strokeWidth,
-			"stroke": strokeColor,
-			"fill": eventFillColor,
-	        "fill-opacity": eventOpacity
-	 	});
-	
-	} else {
-		circle.attr({
-		    "stroke-width": strokeWidth,
-			"stroke": strokeColor,
-			"stroke-dasharray": ".",
-			"fill": eventFillColor,
-	        "fill-opacity": eventOpacity
-	 	});
-	}
-
-	circle.id = element.id;
-	
-	_drawEventIcon(paper, element);
-	
-	return circle;
-}
-
-function _drawServiceTask(element)
-{
-	_drawTask(element);
-	if (element.taskType === "mail")
-	{
-		_drawSendTaskIcon(paper, element.x + 4, element.y + 4);
-	}
-	else if (element.taskType === "camel")
-	{
-		_drawCamelTaskIcon(paper, element.x + 4, element.y + 4);
-	}
-	else if (element.taskType === "mule")
-	{
-		_drawMuleTaskIcon(paper, element.x + 4, element.y + 4);
-	}
-    else if (element.taskType === "http")
-    {
-        _drawHttpTaskIcon(paper, element.x + 4, element.y + 4);
-    }
-	else if (element.stencilIconId)
-	{
-		paper.image("../service/stencilitem/" + element.stencilIconId + "/icon", element.x + 4, element.y + 4, 16, 16);
-	}
-	else
-	{
-		_drawServiceTaskIcon(paper, element.x + 4, element.y + 4);
-	}
-	_addHoverLogic(element, "rect", ACTIVITY_STROKE_COLOR);
-}
-
-function _drawHttpServiceTask(element)
-{
-    _drawTask(element);
-    _drawHttpTaskIcon(paper, element.x + 4, element.y + 4);
-    _addHoverLogic(element, "rect", ACTIVITY_STROKE_COLOR);
-}
-
-function _drawCallActivity(element)
-{
-    var width = element.width - (CALL_ACTIVITY_STROKE / 2);
-    var height = element.height - (CALL_ACTIVITY_STROKE / 2);
-
-    var rect = paper.rect(element.x, element.y, width, height, 4);
-  
-    var strokeColor = _bpmnGetColor(element, ACTIVITY_STROKE_COLOR);
-
-    // Fill
-    var callActivityFillColor = _determineCustomFillColor(element, ACTIVITY_FILL_COLOR);
-
-    // Opacity
-    var callActivityOpacity = 1.0;
-    if (customActivityBackgroundOpacity) {
-        callActivityOpacity = customActivityBackgroundOpacity;
-    }
-
-    rect.attr({"stroke-width": CALL_ACTIVITY_STROKE,
-        "stroke": strokeColor,
-        "fill": callActivityFillColor,
-        "fill-opacity": callActivityOpacity
-    });
-  
-    rect.id = element.id;
-  
-    if (element.name) {
-        this._drawMultilineText(element.name, element.x, element.y, element.width, element.height, "middle", "middle", 11);
-    }
-    _addHoverLogic(element, "rect", ACTIVITY_STROKE_COLOR);
-}
-
-function _drawScriptTask(element)
-{
-	_drawTask(element);
-	_drawScriptTaskIcon(paper, element.x + 4, element.y + 4);
-	_addHoverLogic(element, "rect", ACTIVITY_STROKE_COLOR);
-}
-
-function _drawUserTask(element)
-{
-	_drawTask(element);
-	_drawUserTaskIcon(paper, element.x + 4, element.y + 4);
-	_addHoverLogic(element, "rect", ACTIVITY_STROKE_COLOR);
-}
-
-function _drawBusinessRuleTask(element)
-{
-	_drawTask(element);
-	_drawBusinessRuleTaskIcon(paper, element.x + 4, element.y + 4);
-	_addHoverLogic(element, "rect", ACTIVITY_STROKE_COLOR);
-}
-
-function _drawManualTask(element)
-{
-	_drawTask(element);
-	_drawManualTaskIcon(paper, element.x + 4, element.y + 4);
-	_addHoverLogic(element, "rect", ACTIVITY_STROKE_COLOR);
-}
-
-function _drawSendTask(element)
-{
-    _drawTask(element);
-    _drawSendTaskIcon(paper, element.x + 4, element.y + 4);
-    _addHoverLogic(element, "rect", ACTIVITY_STROKE_COLOR);
-}
-
-function _drawReceiveTask(element)
-{
-	_drawTask(element);
-	_drawReceiveTaskIcon(paper, element.x, element.y);
-	_addHoverLogic(element, "rect", ACTIVITY_STROKE_COLOR);
-}
-
-function _drawTask(element)
-{
-    var rectAttrs = {};
-    
-    // Stroke
-    var strokeColor = _bpmnGetColor(element, ACTIVITY_STROKE_COLOR);
-    rectAttrs['stroke'] = strokeColor;
-    
-    var strokeWidth;
-    if (strokeColor === ACTIVITY_STROKE_COLOR) {
-        strokeWidth = TASK_STROKE;
-    } else {
-        strokeWidth = TASK_HIGHLIGHT_STROKE;
-    }
-    
-	var width = element.width - (strokeWidth / 2);
-	var height = element.height - (strokeWidth / 2);
-
-	var rect = paper.rect(element.x, element.y, width, height, 4);
-    rectAttrs['stroke-width'] = strokeWidth;
-
-    // Fill
-	var fillColor = _determineCustomFillColor(element, ACTIVITY_FILL_COLOR);
-    rectAttrs['fill'] = fillColor;
-
-    // Opacity
-    if (customActivityBackgroundOpacity) {
-        rectAttrs['fill-opacity'] = customActivityBackgroundOpacity;
-    }
-
-	rect.attr(rectAttrs);
-	rect.id = element.id;
-	
-	if (element.name) {
-		this._drawMultilineText(element.name, element.x, element.y, element.width, element.height, "middle", "middle", 11);
-	}
-}
-
-function _drawExclusiveGateway(element)
-{
-	_drawGateway(element);
-	var quarterWidth = element.width / 4;
-	var quarterHeight = element.height / 4;
-	
-	var iks = paper.path(
-		"M" + (element.x + quarterWidth + 3) + " " + (element.y + quarterHeight + 3) + 
-		"L" + (element.x + 3 * quarterWidth - 3) + " " + (element.y + 3 * quarterHeight - 3) + 
-		"M" + (element.x + quarterWidth + 3) + " " + (element.y + 3 * quarterHeight - 3) + 
-		"L" + (element.x + 3 * quarterWidth - 3) + " " + (element.y + quarterHeight + 3)
-	);
-	
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-
-    // Fill
-    var gatewayFillColor = _determineCustomFillColor(element, ACTIVITY_FILL_COLOR);
-
-    // Opacity
-    var gatewayOpacity = 1.0;
-    if (customActivityBackgroundOpacity) {
-        gatewayOpacity = customActivityBackgroundOpacity;
-    }
-
-
-    iks.attr({"stroke-width": 3, "stroke": strokeColor, "fill": gatewayFillColor, "fill-opacity": gatewayOpacity});
-	
-	_addHoverLogic(element, "rhombus", MAIN_STROKE_COLOR);
-}
-
-function _drawParallelGateway(element)
-{
-	_drawGateway(element);
-	
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-	
-	var path1 = paper.path("M 6.75,16 L 25.75,16 M 16,6.75 L 16,25.75");
-
-    // Fill
-    var gatewayFillColor = _determineCustomFillColor(element, ACTIVITY_FILL_COLOR);
-
-    // Opacity
-    var gatewayOpacity = 1.0;
-    if (customActivityBackgroundOpacity) {
-        gatewayOpacity = customActivityBackgroundOpacity;
-    }
-
-	path1.attr({
-		"stroke-width": 3, 
-		"stroke": strokeColor,
-		"fill": gatewayFillColor,
-        "fill-opacity": gatewayOpacity
-	});
-	
-	path1.transform("T" + (element.x + 4) + "," + (element.y + 4));
-	
-	_addHoverLogic(element, "rhombus", MAIN_STROKE_COLOR);
-}
-
-function _drawInclusiveGateway(element)
-{
-	_drawGateway(element);
-	
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-	
-	var circle1 = paper.circle(element.x + (element.width / 2), element.y + (element.height / 2), 9.75);
-
-    // Fill
-    var gatewayFillColor = _determineCustomFillColor(element, ACTIVITY_FILL_COLOR);
-
-    // Opacity
-    var gatewayOpacity = 1.0;
-    if (customActivityBackgroundOpacity) {
-        gatewayOpacity = customActivityBackgroundOpacity;
-    }
-
-	circle1.attr({
-		"stroke-width": 2.5, 
-		"stroke": strokeColor,
-		"fill": gatewayFillColor,
-        "fill-opacity": gatewayOpacity
-	});
-	
-	_addHoverLogic(element, "rhombus", MAIN_STROKE_COLOR);
-}
-
-function _drawEventGateway(element)
-{
-	_drawGateway(element);
-	
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-	
-	var circle1 = paper.circle(element.x + (element.width / 2), element.y + (element.height / 2), 10.4);
-
-    // Fill
-    var gatewayFillColor = _determineCustomFillColor(element, ACTIVITY_FILL_COLOR);
-
-    // Opacity
-    var gatewayOpacity = 1.0;
-    if (customActivityBackgroundOpacity) {
-        gatewayOpacity = customActivityBackgroundOpacity;
-    }
-
-	circle1.attr({
-		"stroke-width": 0.5, 
-		"stroke": strokeColor,
-		"fill": gatewayFillColor,
-        "fill-opacity": gatewayOpacity
-    });
-	
-	var circle2 = paper.circle(element.x + (element.width / 2), element.y + (element.height / 2), 11.7);
-	circle2.attr({
-		"stroke-width": 0.5, 
-		"stroke": strokeColor,
-        "fill": gatewayFillColor,
-        "fill-opacity": gatewayOpacity
-	});
-	
-	var path1 = paper.path("M 20.327514,22.344972 L 11.259248,22.344216 L 8.4577203,13.719549 L 15.794545,8.389969 L 23.130481,13.720774 L 20.327514,22.344972 z");
-	path1.attr({
-		"stroke-width": 1.39999998, 
-		"stroke": strokeColor,
-        "fill": gatewayFillColor,
-        "fill-opacity": gatewayOpacity,
-		"stroke-linejoin": "bevel"
-	});
-	
-	path1.transform("T" + (element.x + 4) + "," + (element.y + 4));
-	
-	_addHoverLogic(element, "rhombus", MAIN_STROKE_COLOR);
-}
-
-function _drawGateway(element)
-{
-    var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-    
-	var rhombus = 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"
-	);
-
-    // Fill
-    var gatewayFillColor = _determineCustomFillColor(element, ACTIVITY_FILL_COLOR);
-
-    // Opacity
-    var gatewayOpacity = 1.0;
-    if (customActivityBackgroundOpacity) {
-        gatewayOpacity = customActivityBackgroundOpacity;
-    }
-
-	rhombus.attr("stroke-width", 2);
-	rhombus.attr("stroke", strokeColor);
-	rhombus.attr("fill", gatewayFillColor);
-    rhombus.attr("fill-opacity", gatewayOpacity);
-	
-	rhombus.id = element.id;
-	
-	return rhombus;
-}
-
-function _drawBoundaryEvent(element)
-{
-	var x = element.x + (element.width / 2);
-	var y = element.y + (element.height / 2);
-
-	var circle = paper.circle(x, y, 15);
-	
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-
- 	if (element.cancelActivity)  {
-		circle.attr({
-		    "stroke-width": 1,
-			"stroke": strokeColor,
-			"fill": "white"
-	 	});
-	 	
-	} else {
-		circle.attr({
-		    "stroke-width": 1,
-		    "stroke-dasharray": ".",
-			"stroke": strokeColor,
-			"fill": "white"
-	 	});
-	}
-	
-	var innerCircle = paper.circle(x, y, 12);
-	
-	if (element.cancelActivity)  {
-		innerCircle.attr({"stroke-width": 1,
-			"stroke": strokeColor,
-			"fill": "none"
-	 	});
-	
-	} else {
-		innerCircle.attr({
-		    "stroke-width": 1,
-		    "stroke-dasharray": ".",
-			"stroke": strokeColor,
-			"fill": "none"
-	 	});
-	}
-	
-	_drawEventIcon(paper, element);
-	_addHoverLogic(element, "circle", MAIN_STROKE_COLOR);
-	
-	circle.id = element.id;
-	innerCircle.id = element.id + "_inner";
-}
-
-function _drawIntermediateCatchEvent(element)
-{
-	var x = element.x + (element.width / 2);
-	var y = element.y + (element.height / 2);
-
-	var circle = paper.circle(x, y, 15);
-	
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-
-	circle.attr({"stroke-width": 1,
-		"stroke": strokeColor,
-		"fill": "white"
- 	});
-	
-	var innerCircle = paper.circle(x, y, 12);
-	
-	innerCircle.attr({"stroke-width": 1,
-		"stroke": strokeColor,
-		"fill": "none"
- 	});
-	
-	_drawEventIcon(paper, element);
-	_addHoverLogic(element, "circle", MAIN_STROKE_COLOR);
-	
-	circle.id = element.id;
-	innerCircle.id = element.id + "_inner";
-}
-
-function _drawThrowEvent(element)
-{
-	var x = element.x + (element.width / 2);
-	var y = element.y + (element.height / 2);
-
-	var circle = paper.circle(x, y, 15);
-
-	var strokeColor = _bpmnGetColor(element, MAIN_STROKE_COLOR);
-	
-	circle.attr({"stroke-width": 1,
-		"stroke": strokeColor,
-		"fill": "white"
- 	});
-	
-	var innerCircle = paper.circle(x, y, 12);
-	
-	innerCircle.attr({"stroke-width": 1,
-		"stroke": strokeColor,
-		"fill": "none"
- 	});
-	
-	_drawEventIcon(paper, element);
-	_addHoverLogic(element, "circle", MAIN_STROKE_COLOR);
-	
-	circle.id = element.id;
-	innerCircle.id = element.id + "_inner";
-}
-
-function _drawMultilineText(text, x, y, boxWidth, boxHeight, horizontalAnchor, verticalAnchor, fontSize) 
-{
-	if (!text || text == "")
-	{
-		return;
-	}
-	
-	var textBoxX, textBoxY;
-    var width = boxWidth - (2 * TEXT_PADDING);
-    
-    if (horizontalAnchor === "middle")
-    {
-    	textBoxX = x + (boxWidth / 2);
-    }
-    else if (horizontalAnchor === "start")
-    {
-    	textBoxX = x;
-    }
-    
-    textBoxY = y + (boxHeight / 2);
-    
- 	var t = paper.text(textBoxX + TEXT_PADDING, textBoxY + TEXT_PADDING).attr({
-        "text-anchor" : horizontalAnchor,
-        "font-family" : "Arial",
-        "font-size" : fontSize,
-        "fill" : "#373e48"
-  	});
-  	
-    var abc = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
-    t.attr({
-        "text" : abc
-    });
-    var letterWidth = t.getBBox().width / abc.length;
-	   
-    t.attr({
-        "text" : text
-    });
-    var removedLineBreaks = text.split("\n");
-    var x = 0, s = [];
-    for (var r = 0; r < removedLineBreaks.length; r++)
-    {
-  	    var words = removedLineBreaks[r].split(" ");
-  	    for ( var i = 0; i < words.length; i++) {
-  
-  	        var l = words[i].length;
-  	        if (x + (l * letterWidth) > width) {
-  	            s.push("\n");
-  	            x = 0;
-  	        }
-  	        x += l * letterWidth;
-  	        s.push(words[i] + " ");
-  	    }
-	  	s.push("\n");
-        x = 0;
-    }
-    t.attr({
-    	"text" : s.join("")
-    });
-    
-    if (verticalAnchor && verticalAnchor === "top")
-    {
-    	t.attr({"y": y + (t.getBBox().height / 2)});
-    }
-}
-
-function _drawTextAnnotation(element)
-{
-	var path1 = paper.path("M20,1 L1,1 L1,50 L20,50");
-	path1.attr({
-		"stroke": "#585858",
-		"fill": "none"
- 	});
-	
-	var annotation = paper.set();
-	annotation.push(path1);
-
-	annotation.transform("T" + element.x + "," + element.y);
-	
-	if (element.text) {
-		this._drawMultilineText(element.text, element.x + 2, element.y, element.width, element.height, "start", "middle", 11);
-	}
-}
- 
-function _drawFlow(flow){
-	
-	var polyline = new Polyline(flow.id, flow.waypoints, SEQUENCEFLOW_STROKE, paper);
-	
-	var strokeColor = _bpmnGetColor(flow, MAIN_STROKE_COLOR);
-	
-	polyline.element = paper.path(polyline.path);
-	polyline.element.attr({"stroke-width":SEQUENCEFLOW_STROKE});
-	polyline.element.attr({"stroke":strokeColor});
-	
-	polyline.element.id = flow.id;
-	
-	var lastLineIndex = polyline.getLinesCount() - 1;
-	var line = polyline.getLine(lastLineIndex);
-	
-	if (line == undefined) return;
-	
-	if (flow.type == "connection" && flow.conditions)
-	{
-		var middleX = (line.x1 + line.x2) / 2;
-		var middleY = (line.y1 + line.y2) / 2;
-		var image = paper.image("../editor/images/condition-flow.png", middleX - 8, middleY - 8, 16, 16);
-	}
-	
-	var polylineInvisible = new Polyline(flow.id, flow.waypoints, SEQUENCEFLOW_STROKE, paper);
-	
-	polylineInvisible.element = paper.path(polyline.path);
-	polylineInvisible.element.attr({
-			"opacity": 0,
-			"stroke-width": 8,
-            "stroke" : "#000000"
-	});
-	
-	_showTip(jQuery(polylineInvisible.element.node), flow);
-	
-	polylineInvisible.element.mouseover(function() {
-		paper.getById(polyline.element.id).attr({"stroke":"blue"});
-	});
-	
-	polylineInvisible.element.mouseout(function() {
-		paper.getById(polyline.element.id).attr({"stroke":"#585858"});
-	});
-	
-	_drawArrowHead(line);
-}
-
-function _drawAssociation(flow){
-	
-	var polyline = new Polyline(flow.id, flow.waypoints, ASSOCIATION_STROKE, paper);
-	
-	polyline.element = paper.path(polyline.path);
-	polyline.element.attr({"stroke-width": ASSOCIATION_STROKE});
-	polyline.element.attr({"stroke-dasharray": ". "});
-	polyline.element.attr({"stroke":"#585858"});
-	
-	polyline.element.id = flow.id;
-	
-	var polylineInvisible = new Polyline(flow.id, flow.waypoints, ASSOCIATION_STROKE, paper);
-	
-	polylineInvisible.element = paper.path(polyline.path);
-	polylineInvisible.element.attr({
-			"opacity": 0,
-			"stroke-width": 8,
-            "stroke" : "#000000"
-	});
-	
-	_showTip(jQuery(polylineInvisible.element.node), flow);
-	
-	polylineInvisible.element.mouseover(function() {
-		paper.getById(polyline.element.id).attr({"stroke":"blue"});
-	});
-	
-	polylineInvisible.element.mouseout(function() {
-		paper.getById(polyline.element.id).attr({"stroke":"#585858"});
-	});
-}
-
-function _drawArrowHead(line, connectionType) 
-{
-	var doubleArrowWidth = 2 * ARROW_WIDTH;
-	
-	var arrowHead = paper.path("M0 0L-" + (ARROW_WIDTH / 2 + .5) + " -" + doubleArrowWidth + "L" + (ARROW_WIDTH/2 + .5) + " -" + doubleArrowWidth + "z");
-	
-	// anti smoothing
-	if (this.strokeWidth%2 == 1)
-		line.x2 += .5, line.y2 += .5;
-	
-	arrowHead.transform("t" + line.x2 + "," + line.y2 + "");
-	arrowHead.transform("...r" + Raphael.deg(line.angle - Math.PI / 2) + " " + 0 + " " + 0);
-	
-	arrowHead.attr("fill", "#585858");
-		
-	arrowHead.attr("stroke-width", SEQUENCEFLOW_STROKE);
-	arrowHead.attr("stroke", "#585858");
-	
-	return arrowHead;
-}
-
-function _determineCustomFillColor(element, defaultColor) {
-
-    var color;
-
-    // By name
-    if (customActivityColors && customActivityColors[element.name]) {
-        color = customActivityColors[element.name];
-    }
-
-    if (color !== null && color !== undefined) {
-        return color;
-    }
-
-    // By id
-    if (customActivityColors && customActivityColors[element.id]) {
-        color = customActivityColors[element.id];
-    }
-
-    if (color !== null && color !== undefined) {
-        return color;
-    }
-
-    return defaultColor;
-}

File diff suppressed because it is too large
+ 0 - 303
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/bpmn-icons.js


+ 0 - 24
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/displaymodel.css

@@ -1,24 +0,0 @@
-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;
-}

+ 0 - 19
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/displaymodel.html

@@ -1,19 +0,0 @@
-<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.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>

+ 0 - 317
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/displaymodel.js

@@ -1,317 +0,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.
- */
-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.CONFIG.contextRoot + '/app/rest/process-instances/history/' + historyModelId + '/model-json';
-	} else {
-    	modelUrl = FLOWABLE.CONFIG.contextRoot + '/app/rest/process-instances/' + modelId + '/model-json';
-	}
-} else if (modelType == 'design') {
-	if (historyModelId) {
-    	modelUrl = FLOWABLE.CONFIG.contextRoot + '/app/rest/models/' + modelId + '/history/' + historyModelId + '/model-json';
-	} else {
-    	modelUrl = FLOWABLE.CONFIG.contextRoot + '/app/rest/models/' + modelId + '/model-json';
-	}
-} else if (modelType == 'process-definition') {
-    modelUrl = FLOWABLE.CONFIG.contextRoot + '/app/rest/process-definitions/' + processDefinitionId + '/model-json';
-}
-
-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");
-});

File diff suppressed because it is too large
+ 0 - 2
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/jquery.qtip.min.css


File diff suppressed because it is too large
+ 0 - 5
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/jquery.qtip.min.js


+ 0 - 37
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/display/package.json

@@ -1,37 +0,0 @@
-{
-  "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"
-  }
-}

+ 0 - 19
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/flowable-header-custom.js

@@ -1,19 +0,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;

+ 0 - 39
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/flowable-toolbar-custom-actions.js

@@ -1,39 +0,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.
- */
-
-// Create custom functions for the FLOWABLE-editor
-FLOWABLE.TOOLBAR.ACTIONS.closeEditor =  function(services) {
-	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"
-    }
-);
-
-
-
-

+ 0 - 504
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-assignment-controller.js

@@ -1,504 +0,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.
- */
-
-/*
- * Assignment
- */
-'use strict';
-
-angular.module('flowableModeler').controller('FlowableAssignmentCtrl', [ '$scope', '$modal', function($scope, $modal) {
-
-    // Config for the modal window
-    var opts = {
-        template:  'editor-app/configuration/properties/assignment-popup.html?version=' + Date.now(),
-        scope: $scope
-    };
-
-    // Open the dialog
-    _internalCreateModal(opts, $modal, $scope);
-}]);
-
-angular.module('flowableModeler').controller('FlowableAssignmentPopupCtrl',
-    [ '$rootScope', '$scope', '$translate', '$http', 'UserService', 'GroupService', function($rootScope, $scope, $translate, $http, UserService, GroupService) {
-
-    // Put json representing assignment on scope
-    if ($scope.property.value !== undefined && $scope.property.value !== null
-        && $scope.property.value.assignment !== undefined
-        && $scope.property.value.assignment !== null) {
-
-        $scope.assignment = $scope.property.value.assignment;
-
-    } else {
-        $scope.assignment = {type:'idm'};
-    }
-
-    $scope.popup = {
-        assignmentObject: {
-            type:$scope.assignment.type,
-            idm: {
-                type:undefined,
-                assignee: undefined,
-                candidateUsers: [],
-                candidateGroups: []
-            },
-            static: {
-                assignee: undefined,
-                candidateUsers: [],
-                candidateGroups: []
-            }
-        }
-    };
-
-
-    $scope.assignmentOptions = [
-        {id: "initiator", title: $translate.instant('PROPERTY.ASSIGNMENT.IDM.DROPDOWN.INITIATOR')},
-        {id: "user", title: $translate.instant('PROPERTY.ASSIGNMENT.IDM.DROPDOWN.USER')},
-        {id: "users", title: $translate.instant('PROPERTY.ASSIGNMENT.IDM.DROPDOWN.USERS')},
-        {id: "groups", title: $translate.instant('PROPERTY.ASSIGNMENT.IDM.DROPDOWN.GROUPS')}
-    ];
-
-    if ($scope.assignment.idm && $scope.assignment.idm.type) {
-        for (var i = 0; i < $scope.assignmentOptions.length; i++) {
-            if ($scope.assignmentOptions[i].id == $scope.assignment.idm.type) {
-                $scope.assignmentOption = $scope.assignmentOptions[i];
-                break;
-            }
-        }
-    }
-
-    // fill the IDM area
-    if (!$scope.assignmentOption) {
-        // Default, first time opening the popup
-        $scope.assignmentOption = $scope.assignmentOptions[0];
-    } else {
-        // Values already filled
-        if ($scope.assignment.idm) { //fill the IDM tab
-            if ($scope.assignment.idm.assignee) {
-                if ($scope.assignment.idm.assignee.id) {
-                    $scope.popup.assignmentObject.idm.assignee = $scope.assignment.idm.assignee;
-                } else {
-                    $scope.popup.assignmentObject.idm.assignee = {email: $scope.assignment.idm.assignee.email};
-                }
-            }
-
-            if ($scope.assignment.idm.candidateUsers && $scope.assignment.idm.candidateUsers.length > 0) {
-                for (var i = 0; i < $scope.assignment.idm.candidateUsers.length; i++) {
-                    $scope.popup.assignmentObject.idm.candidateUsers.push($scope.assignment.idm.candidateUsers[i]);
-                }
-            }
-
-            if ($scope.assignment.idm.candidateGroups && $scope.assignment.idm.candidateGroups.length > 0) {
-                for (var i = 0; i < $scope.assignment.idm.candidateGroups.length; i++) {
-                    $scope.popup.assignmentObject.idm.candidateGroups.push($scope.assignment.idm.candidateGroups[i]);
-                }
-            }
-        }
-    }
-    
-    //fill the static area
-    if ($scope.assignment.assignee) {
-        $scope.popup.assignmentObject.static.assignee = $scope.assignment.assignee;
-    }
-
-    if ($scope.assignment.candidateUsers && $scope.assignment.candidateUsers.length > 0) {
-        for (var i = 0; i < $scope.assignment.candidateUsers.length; i++) {
-            $scope.popup.assignmentObject.static.candidateUsers.push($scope.assignment.candidateUsers[i]);
-        }
-    }
-
-    if ($scope.assignment.candidateGroups && $scope.assignment.candidateGroups.length > 0) {
-        for (var i = 0; i < $scope.assignment.candidateGroups.length; i++) {
-            $scope.popup.assignmentObject.static.candidateGroups.push($scope.assignment.candidateGroups[i]);
-        }
-    }
-
-    initStaticContextForEditing($scope);
-
-    $scope.$watch('popup.groupFilter', function () {
-        $scope.updateGroupFilter();
-    });
-
-    $scope.$watch('popup.filter', function() {
-        $scope.updateFilter();
-    });
-
-    $scope.updateFilter = function() {
-        if ($scope.popup.oldFilter == undefined || $scope.popup.oldFilter != $scope.popup.filter) {
-            if (!$scope.popup.filter) {
-                $scope.popup.oldFilter = '';
-            } else {
-                $scope.popup.oldFilter = $scope.popup.filter;
-            }
-
-            if ($scope.popup.filter !== null && $scope.popup.filter !== undefined) {
-                UserService.getFilteredUsers($scope.popup.filter).then(function (result) {
-                    var filteredUsers = [];
-                    for (var i=0; i<result.data.length; i++) {
-                        var filteredUser = result.data[i];
-
-                        var foundCandidateUser = false;
-                        if ($scope.popup.assignmentObject.idm.candidateUsers !== null && $scope.popup.assignmentObject.idm.candidateUsers !== undefined) {
-                            for (var j=0; j<$scope.popup.assignmentObject.idm.candidateUsers.length; j++) {
-                                var candidateUser = $scope.popup.assignmentObject.idm.candidateUsers[j];
-                                if (candidateUser.id === filteredUser.id) {
-                                    foundCandidateUser = true;
-                                    break;
-                                }
-                            }
-                        }
-
-                        if (!foundCandidateUser) {
-                            filteredUsers.push(filteredUser);
-                        }
-
-                    }
-
-                    $scope.popup.userResults = filteredUsers;
-                    $scope.resetSelection();
-                });
-            }
-        }
-    };
-
-    $scope.updateGroupFilter = function() {
-        if ($scope.popup.oldGroupFilter == undefined || $scope.popup.oldGroupFilter != $scope.popup.groupFilter) {
-            if (!$scope.popup.groupFilter) {
-                $scope.popup.oldGroupFilter = '';
-            } else {
-                $scope.popup.oldGroupFilter = $scope.popup.groupFilter;
-            }
-
-            GroupService.getFilteredGroups($scope.popup.groupFilter).then(function(result) {
-                $scope.popup.groupResults = result.data;
-                $scope.resetGroupSelection();
-            });
-        }
-    };
-
-    $scope.confirmUser = function(user) {
-        if (!user) {
-            // Selection is done with keyboard, use selection index
-            var users = $scope.popup.userResults;
-            if ($scope.popup.selectedIndex >= 0 && $scope.popup.selectedIndex < users.length) {
-                user = users[$scope.popup.selectedIndex];
-            }
-        }
-
-        if (user) {
-            if ("user" == $scope.assignmentOption.id) {
-                $scope.popup.assignmentObject.idm.assignee = user;
-            } else if ("users" == $scope.assignmentOption.id) {
-
-                // Only add if not yet part of candidate users
-                var found = false;
-                if ($scope.popup.assignmentObject.idm.candidateUsers) {
-                    for (var i = 0; i < $scope.popup.assignmentObject.idm.candidateUsers.length; i++) {
-                        if ($scope.popup.assignmentObject.idm.candidateUsers[i].id === user.id) {
-                            found = true;
-                            break;
-                        }
-                    }
-                }
-
-                if (!found) {
-                    $scope.addCandidateUser(user);
-                }
-            }
-        }
-    };
-
-    $scope.confirmEmail = function() {
-        if ("user" == $scope.assignmentOption.id) {
-            $scope.popup.assignmentObject.idm.assignee = {email: $scope.popup.email};
-        } else if ("users" == $scope.assignmentOption.id) {
-
-            // Only add if not yet part of candidate users
-            var found = false;
-            if ($scope.popup.assignmentObject.idm.candidateUsers) {
-                for (var i = 0; i < $scope.popup.assignmentObject.idm.candidateUsers.length; i++) {
-
-                    if ($scope.popup.assignmentObject.idm.candidateUsers[i].id) {
-                        if ($scope.popup.assignmentObject.idm.candidateUsers[i].id === user.id) {
-                            found = true;
-                            break;
-                        }
-                    } else if ($scope.popup.assignmentObject.idm.candidateUsers[i].email) {
-                        if ($scope.popup.assignmentObject.idm.candidateUsers[i].email === $scope.popup.email) {
-                            found = true;
-                            break;
-                        }
-                    }
-                }
-            }
-
-            if (!found) {
-                $scope.addCandidateUser({email: $scope.popup.email});
-            }
-        }
-    };
-
-    $scope.confirmGroup = function(group) {
-        if (!group) {
-            // Selection is done with keyboard, use selection index
-            var groups = $scope.popup.groupResults;
-            if ($scope.popup.selectedGroupIndex >= 0 && $scope.popup.selectedGroupIndex < groups.length) {
-                group = groups[$scope.popup.selectedGroupIndex];
-            }
-        }
-
-        if (group) {
-            // Only add if not yet part of candidate groups
-            var found = false;
-            if ($scope.popup.assignmentObject.idm.candidateGroups) {
-                for (var i = 0; i < $scope.popup.assignmentObject.idm.candidateGroups.length; i++) {
-                    if ($scope.popup.assignmentObject.idm.candidateGroups[i].id === group.id) {
-                        found = true;
-                        break;
-                    }
-                }
-            }
-
-            if (!found) {
-                $scope.addCandidateGroup(group);
-            }
-        }
-    };
-
-    $scope.addCandidateUser = function(user) {
-        $scope.popup.assignmentObject.idm.candidateUsers.push(user);
-    };
-    
-    $scope.removeCandidateUser = function(user) {
-        var users = $scope.popup.assignmentObject.idm.candidateUsers;
-        var indexToRemove = -1;
-        for (var i = 0; i < users.length; i++) {
-            if (user.id) {
-                if (user.id === users[i].id) {
-                    indexToRemove = i;
-                    break;
-                }
-            } else {
-                if (user.email === users[i].email) {
-                    indexToRemove = i;
-                    break;
-                }
-            }
-        }
-        if (indexToRemove >= 0) {
-            users.splice(indexToRemove, 1);
-        }
-    };
-    
-    $scope.addCandidateGroup = function(group) {
-        $scope.popup.assignmentObject.idm.candidateGroups.push(group);
-    };
-    
-    $scope.removeCandidateGroup = function(group) {
-        var groups = $scope.popup.assignmentObject.idm.candidateGroups;
-        var indexToRemove = -1;
-        for (var i = 0; i < groups.length; i++) {
-            if (group.id == groups[i].id) {
-                indexToRemove = i;
-                break;
-            }
-        }
-        if (indexToRemove >= 0) {
-            groups.splice(indexToRemove, 1);
-        }
-    };
-
-    $scope.resetSelection = function() {
-        if ($scope.popup.userResults && $scope.popup.userResults.length > 0) {
-            $scope.popup.selectedIndex = 0;
-        } else {
-            $scope.popup.selectedIndex = -1;
-        }
-    };
-
-    $scope.nextUser = function() {
-        var users = $scope.popup.userResults;
-        if (users && users.length > 0 && $scope.popup.selectedIndex < users.length -1) {
-            $scope.popup.selectedIndex += 1;
-        }
-    };
-
-    $scope.previousUser = function() {
-        var users = $scope.popup.userResults;
-        if (users && users.length > 0 && $scope.popup.selectedIndex > 0) {
-            $scope.popup.selectedIndex -= 1;
-        }
-    };
-
-    $scope.resetGroupSelection = function() {
-        if ($scope.popup.groupResults && $scope.popup.groupResults.length > 0) {
-            $scope.popup.selectedGroupIndex = 0;
-        } else {
-            $scope.popup.selectedGroupIndex = -1;
-        }
-    };
-
-    $scope.nextGroup = function() {
-        var groups = $scope.popup.groupResults;
-        if (groups && groups.length > 0 && $scope.popup.selectedGroupIndex < groups.length -1) {
-            $scope.popup.selectedGroupIndex += 1;
-        }
-    };
-
-    $scope.previousGroup = function() {
-        var groups = $scope.popup.groupResults;
-        if (groups && groups.length > 0 && $scope.popup.selectedGroupIndex > 0) {
-            $scope.popup.selectedGroupIndex -= 1;
-        }
-    };
-
-    $scope.removeAssignee = function() {
-        $scope.popup.assignmentObject.idm.assignee = undefined;
-    };
-    
-    // Click handler for + button after enum value
-    $scope.addCandidateUserValue = function(index) {
-        $scope.popup.assignmentObject.static.candidateUsers.splice(index + 1, 0, {value: ''});
-    };
-
-    // Click handler for - button after enum value
-    $scope.removeCandidateUserValue = function(index) {
-        $scope.popup.assignmentObject.static.candidateUsers.splice(index, 1);
-    };
-
-    // Click handler for + button after enum value
-    $scope.addCandidateGroupValue = function(index) {
-        $scope.popup.assignmentObject.static.candidateGroups.splice(index + 1, 0, {value: ''});
-    };
-
-    // Click handler for - button after enum value
-    $scope.removeCandidateGroupValue = function(index) {
-        $scope.popup.assignmentObject.static.candidateGroups.splice(index, 1);
-    };
-    
-    $scope.setSearchType = function() {
-        $scope.popup.assignmentObject.assignmentSourceType = 'search';
-    };
-
-    $scope.allSteps = EDITOR.UTIL.collectSortedElementsFromPrecedingElements($scope.selectedShape);
-
-    $scope.save = function () {
-
-        handleAssignmentInput($scope.popup.assignmentObject.static);
-
-        $scope.assignment.type = $scope.popup.assignmentObject.type;
-
-        if ('idm' === $scope.popup.assignmentObject.type) { // IDM
-            $scope.popup.assignmentObject.static = undefined;
-
-            //Construct an IDM object to be saved to the process model.
-            var idm = {type: $scope.assignmentOption.id};
-            if ('user' == idm.type) {
-                if ($scope.popup.assignmentObject.idm.assignee) {
-                    idm.assignee = $scope.popup.assignmentObject.idm.assignee;
-                }
-            } else if ('users' == idm.type) {
-                if ($scope.popup.assignmentObject.idm.candidateUsers && $scope.popup.assignmentObject.idm.candidateUsers.length > 0) {
-                    idm.candidateUsers = $scope.popup.assignmentObject.idm.candidateUsers;
-                }
-            } else if ('groups' == idm.type) {
-                if ($scope.popup.assignmentObject.idm.candidateGroups && $scope.popup.assignmentObject.idm.candidateGroups.length > 0) {
-                    idm.candidateGroups = $scope.popup.assignmentObject.idm.candidateGroups;
-                }
-            }
-            $scope.assignment.idm = idm;
-            $scope.assignment.assignee = undefined;
-            $scope.assignment.candidateUsers = undefined;
-            $scope.assignment.candidateGroups = undefined;
-
-        }
-
-        if ('static' === $scope.popup.assignmentObject.type) { // IDM
-            $scope.popup.assignmentObject.idm = undefined;
-            $scope.assignment.idm = undefined;
-            $scope.assignment.assignee = $scope.popup.assignmentObject.static.assignee;
-            $scope.assignment.candidateUsers = $scope.popup.assignmentObject.static.candidateUsers;
-            $scope.assignment.candidateGroups = $scope.popup.assignmentObject.static.candidateGroups;
-        }
-
-        $scope.property.value = {};
-        $scope.property.value.assignment = $scope.assignment;
-        $scope.updatePropertyInModel($scope.property);
-        $scope.close();
-    };
-
-    // Close button handler
-    $scope.close = function() {
-    	$scope.property.mode = 'read';
-    	$scope.$hide();
-    };
-
-    var handleAssignmentInput = function ($assignment) {
-    
-        function isEmptyString(value) {
-          return (value === undefined || value === null || value.trim().length === 0);
-        }
-    
-        if (isEmptyString($assignment.assignee)){
-          $assignment.assignee = undefined;
-        }
-        var toRemoveIndexes;
-        var removedItems=0;
-        var i = 0;
-        if ($assignment.candidateUsers) {
-          toRemoveIndexes = [];
-          for (i = 0; i < $assignment.candidateUsers.length; i++) {
-            if (isEmptyString($assignment.candidateUsers[i].value)) {
-              toRemoveIndexes[toRemoveIndexes.length] = i;
-            }
-          }
-    
-          if (toRemoveIndexes.length == $assignment.candidateUsers.length) {
-            $assignment.candidateUsers = undefined;
-          } else {
-             removedItems=0;
-            for (i = 0; i < toRemoveIndexes.length; i++) {
-              $assignment.candidateUsers.splice(toRemoveIndexes[i]-removedItems, 1);
-              removedItems++;
-            }
-          }
-        }
-    
-        if ($assignment.candidateGroups) {
-          toRemoveIndexes = [];
-          for (i = 0; i < $assignment.candidateGroups.length; i++) {
-            if (isEmptyString($assignment.candidateGroups[i].value)) {
-              toRemoveIndexes[toRemoveIndexes.length] = i;
-            }
-          }
-    
-          if (toRemoveIndexes.length == $assignment.candidateGroups.length) {
-            $assignment.candidateGroups = undefined;
-          } else {
-             removedItems=0;
-            for (i = 0; i < toRemoveIndexes.length; i++) {
-              $assignment.candidateGroups.splice(toRemoveIndexes[i]-removedItems, 1);
-              removedItems++;
-            }
-          }
-        }
-    };
-    
-    function initStaticContextForEditing($scope) {
-        if (!$scope.popup.assignmentObject.static.candidateUsers || $scope.popup.assignmentObject.static.candidateUsers.length==0) {
-          $scope.popup.assignmentObject.static.candidateUsers = [{value: ''}];
-        }
-        if (!$scope.popup.assignmentObject.static.candidateGroups || $scope.popup.assignmentObject.static.candidateGroups.length==0) {
-          $scope.popup.assignmentObject.static.candidateGroups = [{value: ''}];
-        }
-    }
-}]);

+ 0 - 80
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-collapsed-subprocess-controller.js

@@ -1,80 +0,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.
- */
-
-angular.module('flowableModeler').controller('FlowableCollapsedSubprocessReferenceCtrl',
-    [ '$scope', '$modal', '$http', function($scope, $modal, $http) {
-	
-     // Config for the modal window
-     var opts = {
-         template:  'editor-app/configuration/properties/subprocess-reference-popup.html?version=' + Date.now(),
-         scope: $scope
-     };
-
-     // Open the dialog
-        _internalCreateModal(opts, $modal, $scope);
-}]);
-
-angular.module('flowableModeler').controller('FlowableCollapsedSubprocessReferencePopupCtrl', [ '$scope', '$http', function($scope, $http) {
-	
-    $scope.state = {'loadingSubprocesses' : true, 'error' : false};
-    
-    // Close button handler
-    $scope.close = function() {
-    	$scope.property.mode = 'read';
-        $scope.$hide();
-    };
-    
-    // Selecting/deselecting a subprocess
-    $scope.selectSubProcess = function(sub, $event) {
-   	 	$event.stopPropagation();
-   	 	if ($scope.selectedSubProcess && $scope.selectedSubProcess.id && sub.id == $scope.selectedSubProcess.id) {
-   	 		// un-select the current selection
-   	 		$scope.selectedSubProcess = null;
-   	 	} else {
-   	 		$scope.selectedSubProcess = sub;
-   	 	}
-    };
-    
-    // Saving the selected value
-    $scope.save = function() {
-   	 	if ($scope.selectedSubProcess) {
-   	 		$scope.property.value = {'id' : $scope.selectedSubProcess.id, 'name' : $scope.selectedSubProcess.name};
-   	 	} else {
-   	 		$scope.property.value = null; 
-   	 	}
-   	 	$scope.updatePropertyInModel($scope.property);
-   	 	$scope.close();
-    };
-    
-    $scope.loadProcesses = function() {
-   	 
-    	$http.get(FLOWABLE.CONFIG.contextRoot + '/app/rest/models?filter=myprocesses')
-    		.success(
-    			function(response) {
-    				$scope.state.loadingSubprocesses = false;
-    				$scope.state.subprocessError = false;
-    				$scope.subProcesses = response.data;
-    			})
-    		.error(
-    			function(data, status, headers, config) {
-    				$scope.state.loadingSubprocesses = false;
-    				$scope.state.subprocessError = true;
-    			});
-    };
-    
-    if ($scope.property && $scope.property.value && $scope.property.value.id) {
-   	 	$scope.selectedSubProcess = $scope.property.value;
-    }
-    
-    $scope.loadProcesses();  
-}]);

+ 0 - 59
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-condition-expression-controller.js

@@ -1,59 +0,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.
- */
-
-/*
- * 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();
-    };
-
-}]);

+ 0 - 12
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-custom-controllers.js

@@ -1,12 +0,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.
- */

+ 0 - 288
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-decisiontable-reference-controller.js

@@ -1,288 +0,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.
- */
-
-angular.module('flowableModeler').controller('FlowableDecisionTableReferenceCtrl',
-    [ '$scope', '$modal', '$http', function($scope, $modal, $http) {
-	
-     // Config for the modal window
-     var opts = {
-         template:  'editor-app/configuration/properties/decisiontable-reference-popup.html?version=' + Date.now(),
-         scope: $scope
-     };
-
-     // Open the dialog
-     _internalCreateModal(opts, $modal, $scope);
-}]);
- 
-angular.module('flowableModeler').controller('FlowableDecisionTableReferencePopupCtrl', ['$rootScope', '$scope', '$http', '$location', 'editorManager',
-    function($rootScope, $scope, $http, $location, editorManager) {
-
-        $scope.state = {
-            'loadingDecisionTables': true,
-            'decisionTableError': false
-        };
-
-        $scope.popup = {
-            'state': 'decisionTableReference'
-        };
-
-        $scope.foldersBreadCrumbs = [];
-
-        // Make click outside dialog also call close.
-        $scope.$parent.$on('modal.hide.before', function() {
-            $scope.close();
-            $scope.$parent.$apply();
-        });
-
-        // Close button handler
-        $scope.close = function() {
-            $scope.property.newVariablesMapping = undefined;
-            $scope.property.mode = 'read';
-            $scope.$hide();
-        };
-
-        // Selecting/deselecting a decision table
-        $scope.selectDecisionTable = function(decisionTable, $event) {
-            $event.stopPropagation();
-            if ($scope.selectedDecisionTable && $scope.selectedDecisionTable.id && decisionTable.id == $scope.selectedDecisionTable.id) {
-                // un-select the current selection
-                $scope.selectedDecisionTable = null;
-            } else {
-                $scope.selectedDecisionTable = decisionTable;
-            }
-        };
-
-        $scope.isSelected = function () {
-            if ($scope.selectedDecisionTable && $scope.selectedDecisionTable.id) {
-                return true;
-            }
-            return false;
-        };
-
-        // Saving the selected value
-        $scope.save = function() {
-            if ($scope.selectedDecisionTable) {
-                $scope.property.value = {
-                    'id': $scope.selectedDecisionTable.id,
-                    'name': $scope.selectedDecisionTable.name,
-                    'key': $scope.selectedDecisionTable.key
-                };
-                
-            } else {
-                $scope.property.value = null;
-            }
-            $scope.updatePropertyInModel($scope.property);
-            $scope.close();
-        };
-
-        // Open the selected value
-        $scope.open = function() {
-            if ($scope.selectedDecisionTable) {
-                $scope.property.value = {
-                    'id': $scope.selectedDecisionTable.id,
-                    'name': $scope.selectedDecisionTable.name,
-                    'key': $scope.selectedDecisionTable.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
-                        });
-
-						$rootScope.addHistoryItem($scope.selectedShape.resourceId);
-						$location.path('decision-table-editor/' + $scope.selectedDecisionTable.id);
-                    })
-                    .error(function(data, status, headers, config) {
-
-                    });
-                
-                $scope.close();
-            }
-        };
-
-        $scope.newDecisionTable = function() {
-            $scope.property.value.variablesmapping = [];
-
-            $scope.popup.state = 'newDecisionTable';
-
-            var modelMetaData = editorManager.getBaseModelData();
-
-            $scope.model = {
-                loading: false,
-                decisionTable: {
-                    name: '',
-                    key: '',
-                    description: '',
-                    modelType: 4
-                },
-                defaultStencilSet: undefined,
-                decisionTableStencilSets: []
-            };
-        };
-
-        $scope.createDecisionTable = function() {
-
-            if (!$scope.model.decisionTable.name || $scope.model.decisionTable.name.length == 0 ||
-            	!$scope.model.decisionTable.key || $scope.model.decisionTable.key.length == 0) {
-            	
-                return;
-            }
-
-            var stencilSetId = $scope.model.decisionTable.stencilSet;
-            $scope.model.loading = true;
-
-            $http({
-                method: 'POST',
-                url: FLOWABLE.CONFIG.contextRoot + '/app/rest/models',
-                data: $scope.model.decisionTable
-            }).
-            success(function(data, status, headers, config) {
-
-                var newDecisionTableId = data.id;
-                $scope.property.value = {
-                    'id': newDecisionTableId,
-                    '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,
-                    stencilSet: stencilSetId
-                };
-
-                // 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();
-                        
-                        $rootScope.addHistoryItem($scope.selectedShape.resourceId);
-                        $location.path('decision-table-editor/' + newDecisionTableId);
-                    })
-                    .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.resetCurrent = function () {
-            for (var i = 0, found = false; i < $scope.decisionTables.length && found === false; i++) {
-                var table = $scope.decisionTables[i];
-                if (table.id === $scope.property.value.id) {
-                    $scope.selectedDecisionTable = table;
-                    found = true;
-                }
-            }
-        };
-
-        $scope.loadDecisionTables = function() {
-            var modelMetaData = editorManager.getBaseModelData();
-            $http.get(FLOWABLE.CONFIG.contextRoot + '/app/rest/decision-table-models')
-                .success(
-                    function(response) {
-                        $scope.state.loadingDecisionTables = false;
-                        $scope.state.decisionTableError = false;
-                        $scope.decisionTables = response.data;
-                        $scope.resetCurrent();
-                    })
-                .error(
-                    function(data, status, headers, config) {
-                        $scope.state.loadingDecisionTables = false;
-                        $scope.state.decisionTableError = true;
-                    });
-        };
-
-        if ($scope.property && $scope.property.value && $scope.property.value.id) {
-            $scope.selectedDecisionTable = $scope.property.value;
-            $scope.storedId = $scope.property.value.id;
-        }
-
-        $scope.loadDecisionTables();
-    }
-]);

+ 0 - 126
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-duedate-controller.js

@@ -1,126 +0,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.
- */
-
-/*
- * 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();
-    };
-}]);

+ 0 - 263
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-event-listeners-controller.js

@@ -1,263 +0,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.
- */
-
-/*
- * Execution listeners
- */
-
-angular.module('flowableModeler').controller('FlowableEventListenersCtrl',
-    ['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
-
-        // Config for the modal window
-        var opts = {
-            template: 'editor-app/configuration/properties/event-listeners-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('FlowableEventListenersPopupCtrl',
-    ['$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.eventListeners !== undefined
-            && $scope.property.value.eventListeners !== null) {
-
-            if ($scope.property.value.eventListeners.constructor == String) {
-                $scope.eventListeners = JSON.parse($scope.property.value.eventListeners);
-            }
-            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.eventListeners = angular.copy($scope.property.value.eventListeners);
-            }
-
-        } else {
-            $scope.eventListeners = [];
-        }
-
-        $scope.translationsRetrieved = false;
-        $scope.labels = {};
-
-        var eventPromise = $translate('PROPERTY.EXECUTIONLISTENERS.EVENT');
-        var implementationPromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.IMPLEMENTATION');
-        var namePromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.NAME');
-
-        $q.all([eventPromise, implementationPromise, namePromise]).then(function (results) {
-            $scope.labels.eventLabel = results[0];
-            $scope.labels.implementationLabel = results[1];
-            $scope.labels.nameLabel = results[2];
-            $scope.translationsRetrieved = true;
-
-            // Config for grid
-            $scope.gridOptions = {
-                data: $scope.eventListeners,
-                headerRowHeight: 28,
-                enableRowSelection: true,
-                enableRowHeaderSelection: false,
-                multiSelect: false,
-                modifierKeysToMultiSelect: false,
-                enableHorizontalScrollbar: 0,
-                enableColumnMenus: false,
-                enableSorting: false,
-                columnDefs: [{field: 'event', displayName: $scope.labels.eventLabel},
-                    {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.selectedListener = row.entity;
-
-                    if ($scope.selectedListener) {
-                        var fields = $scope.selectedListener.fields;
-                        if (fields !== undefined && fields !== null) {
-                            for (var i = 0; i < fields.length; i++) {
-                                var field = 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.selectedListener.fields = [];
-                        }
-                        if (!$scope.selectedListener.events) {
-                            $scope.selectedListener.events = [{event: ''}];
-                        }
-                    }
-                });
-            };
-        });
-
-
-        // Click handler for + button after enum value
-        $scope.addEventValue = function (index) {
-            $scope.selectedListener.events.splice(index + 1, 0, {event: ''});
-        };
-
-        // Click handler for - button after enum value
-        $scope.removeEventValue = function (index) {
-            $scope.selectedListener.events.splice(index, 1);
-            $scope.listenerDetailsChanged();
-        };
-
-        $scope.listenerDetailsChanged = function () {
-            var listener = $scope.selectedListener;
-            if (listener.events) {
-                var eventText = '';
-                for (var i = 0; i < listener.events.length; i++) {
-                    if (i > 0) {
-                        eventText += ", ";
-                    }
-                    eventText += listener.events[i].event;
-                }
-                $scope.selectedListener.event = eventText;
-            }
-
-            if (listener.rethrowEvent) {
-                var implementationText = '';
-                if (listener.rethrowType && listener.rethrowType.length > 0) {
-                    if (listener.rethrowType === 'error' && listener.errorcode !== '') {
-                        implementationText = "Rethrow as error " + listener.errorcode;
-                    }
-                    else if (listener.rethrowType === 'message' && listener.messagename !== '') {
-                        implementationText = "Rethrow as message " + listener.messagename;
-                    }
-                    else if ((listener.rethrowType === 'signal' || listener.rethrowType === 'globalSignal') && listener.signalname !== '') {
-                        implementationText = "Rethrow as signal " + listener.signalname;
-                    }
-                }
-                $scope.selectedListener.implementation = implementationText;
-            }
-            else {
-                if ($scope.selectedListener.className !== '') {
-                    $scope.selectedListener.implementation = $scope.selectedListener.className;
-                }
-                else if ($scope.selectedListener.delegateExpression !== '') {
-                    $scope.selectedListener.implementation = $scope.selectedListener.delegateExpression;
-                }
-                else {
-                    $scope.selectedListener.implementation = '';
-                }
-            }
-        };
-
-        // Click handler for add button
-        $scope.addNewListener = function () {
-            var newListener = {
-                event: '',
-                implementation: '',
-                className: '',
-                delegateExpression: '',
-                retrowEvent: false
-            };
-
-            $scope.eventListeners.push(newListener);
-
-            $timeout(function () {
-                $scope.gridApi.selection.toggleRowSelection(newListener);
-            });
-        };
-
-        // Click handler for remove button
-        $scope.removeListener = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.eventListeners.indexOf(selectedItems[0]);
-                $scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
-                $scope.eventListeners.splice(index, 1);
-
-                if ($scope.eventListeners.length == 0) {
-                    $scope.selectedListener = undefined;
-                }
-
-                $timeout(function () {
-                    if ($scope.eventListeners.length > 0) {
-                        $scope.gridApi.selection.toggleRowSelection($scope.eventListeners[0]);
-                    }
-                });
-            }
-        };
-
-        // Click handler for up button
-        $scope.moveListenerUp = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.eventListeners.indexOf(selectedItems[0]);
-                if (index != 0) { // If it's the first, no moving up of course
-                    var temp = $scope.eventListeners[index];
-                    $scope.eventListeners.splice(index, 1);
-                    $timeout(function () {
-                        $scope.eventListeners.splice(index + -1, 0, temp);
-                        $timeout(function () {
-                            $scope.gridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        // Click handler for down button
-        $scope.moveListenerDown = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.eventListeners.indexOf(selectedItems[0]);
-                if (index != $scope.eventListeners.length - 1) { // If it's the last element, no moving down of course
-                    var temp = $scope.eventListeners[index];
-                    $scope.eventListeners.splice(index, 1);
-                    $timeout(function () {
-                        $scope.eventListeners.splice(index + 1, 0, temp);
-                        $timeout(function () {
-                            $scope.gridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        // Click handler for save button
-        $scope.save = function () {
-
-            if ($scope.eventListeners.length > 0) {
-                $scope.property.value = {};
-                $scope.property.value.eventListeners = $scope.eventListeners;
-            } 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();
-        };
-
-    }]);

+ 0 - 358
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-execution-listeners-controller.js

@@ -1,358 +0,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.
- */
-
-/*
- * Execution listeners
- */
-
-angular.module('flowableModeler').controller('FlowableExecutionListenersCtrl',
-    ['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
-
-        // Config for the modal window
-        var opts = {
-            template: 'editor-app/configuration/properties/execution-listeners-popup.html?version=' + Date.now(),
-            scope: $scope
-        };
-
-        // Open the dialog
-        _internalCreateModal(opts, $modal, $scope);
-    }]);
-
-angular.module('flowableModeler').controller('FlowableExecutionListenersPopupCtrl',
-    ['$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.executionListeners !== undefined
-            && $scope.property.value.executionListeners !== null) {
-
-            if ($scope.property.value.executionListeners.constructor == String) {
-                $scope.executionListeners = JSON.parse($scope.property.value.executionListeners);
-            }
-            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.executionListeners = angular.copy($scope.property.value.executionListeners);
-            }
-
-            for (var i = 0; i < $scope.executionListeners.length; i++) {
-                var executionListener = $scope.executionListeners[i];
-                if (executionListener.className !== undefined && executionListener.className !== '') {
-                    executionListener.implementation = executionListener.className;
-                }
-                else if (executionListener.expression !== undefined && executionListener.expression !== '') {
-                    executionListener.implementation = executionListener.expression;
-                }
-                else if (executionListener.delegateExpression !== undefined && executionListener.delegateExpression !== '') {
-                    executionListener.implementation = executionListener.delegateExpression;
-                }
-            }
-        } else {
-            $scope.executionListeners = [];
-        }
-
-        $scope.selectedListener = undefined;
-        $scope.selectedField = undefined;
-        $scope.fields = [];
-        $scope.translationsRetrieved = false;
-
-        $scope.labels = {};
-
-        var eventPromise = $translate('PROPERTY.EXECUTIONLISTENERS.EVENT');
-        var implementationPromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.IMPLEMENTATION');
-        var namePromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.NAME');
-
-        $q.all([eventPromise, implementationPromise, namePromise]).then(function (results) {
-            $scope.labels.eventLabel = results[0];
-            $scope.labels.implementationLabel = results[1];
-            $scope.labels.nameLabel = results[2];
-            $scope.translationsRetrieved = true;
-
-            // Config for grid
-            $scope.gridOptions = {
-                data: $scope.executionListeners,
-                headerRowHeight: 28,
-                enableRowSelection: true,
-                enableRowHeaderSelection: false,
-                multiSelect: false,
-                modifierKeysToMultiSelect: false,
-                enableHorizontalScrollbar: 0,
-                enableColumnMenus: false,
-                enableSorting: false,
-                columnDefs: [{field: 'event', displayName: $scope.labels.eventLabel},
-                    {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.selectedListener = row.entity;
-                    $scope.selectedField = undefined;
-                    if ($scope.selectedListener) {
-                        var fields = $scope.selectedListener.fields;
-                        if (fields !== undefined && fields !== null) {
-                            for (var i = 0; i < fields.length; i++) {
-                                var field = 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.selectedListener.fields = [];
-                        }
-
-                        $scope.fields.length = 0;
-                        for (var i = 0; i < $scope.selectedListener.fields.length; i++) {
-                            $scope.fields.push($scope.selectedListener.fields[i]);
-                        }
-                    }
-                });
-            };
-
-            // Config for field grid
-            $scope.gridFieldOptions = {
-                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.name},
-                    {field: 'implementation', displayName: $scope.labels.implementationLabel}]
-            };
-
-            $scope.gridFieldOptions.onRegisterApi = function (gridApi) {
-                // set gridApi on scope
-                $scope.fieldGridApi = gridApi;
-                gridApi.selection.on.rowSelectionChanged($scope, function (row) {
-                    $scope.selectedField = row.entity;
-                });
-            };
-        });
-
-        $scope.listenerDetailsChanged = function () {
-            if ($scope.selectedListener.className !== '') {
-                $scope.selectedListener.implementation = $scope.selectedListener.className;
-            } else if ($scope.selectedListener.expression !== '') {
-                $scope.selectedListener.implementation = $scope.selectedListener.expression;
-            } else if ($scope.selectedListener.delegateExpression !== '') {
-                $scope.selectedListener.implementation = $scope.selectedListener.delegateExpression;
-            } else {
-                $scope.selectedListener.implementation = '';
-            }
-        };
-
-        // Click handler for add button
-        $scope.addNewListener = function () {
-            var newListener = {
-                event: 'start',
-                implementation: '',
-                className: '',
-                expression: '',
-                delegateExpression: ''
-            };
-            $scope.executionListeners.push(newListener);
-
-            $timeout(function () {
-                $scope.gridApi.selection.toggleRowSelection(newListener);
-            });
-        };
-
-        // Click handler for remove button
-        $scope.removeListener = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.executionListeners.indexOf(selectedItems[0]);
-                $scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
-
-                $scope.executionListeners.splice(index, 1);
-
-                if ($scope.executionListeners.length == 0) {
-                    $scope.selectedListener = undefined;
-                }
-
-                $timeout(function () {
-                    if ($scope.executionListeners.length > 0) {
-                        $scope.gridApi.selection.toggleRowSelection($scope.executionListeners[0]);
-                    }
-                });
-            }
-        };
-
-        // Click handler for up button
-        $scope.moveListenerUp = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.executionListeners.indexOf(selectedItems[0]);
-                if (index != 0) { // If it's the first, no moving up of course
-                    var temp = $scope.executionListeners[index];
-                    $scope.executionListeners.splice(index, 1);
-                    $timeout(function () {
-                        $scope.executionListeners.splice(index + -1, 0, temp);
-                        $timeout(function () {
-                            $scope.gridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        // Click handler for down button
-        $scope.moveListenerDown = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.executionListeners.indexOf(selectedItems[0]);
-                if (index != $scope.executionListeners.length - 1) { // If it's the last element, no moving down of course
-                    var temp = $scope.executionListeners[index];
-                    $scope.executionListeners.splice(index, 1);
-                    $timeout(function () {
-                        $scope.executionListeners.splice(index + 1, 0, temp);
-                        $timeout(function () {
-                            $scope.gridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        $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 () {
-            if ($scope.selectedListener) {
-                if ($scope.selectedListener.fields == undefined) {
-                    $scope.selectedListener.fields = [];
-                }
-
-                var newField = {
-                    name: 'fieldName',
-                    implementation: '',
-                    stringValue: '',
-                    expression: '',
-                    string: ''
-                };
-                $scope.fields.push(newField);
-                $scope.selectedListener.fields.push(newField);
-
-                $timeout(function () {
-                    $scope.fieldGridApi.selection.toggleRowSelection(newField);
-                });
-            }
-        };
-
-        // Click handler for remove button
-        $scope.removeField = function () {
-            var selectedItems = $scope.fieldGridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.fields.indexOf(selectedItems[0]);
-                $scope.fieldGridApi.selection.toggleRowSelection(selectedItems[0]);
-
-                $scope.fields.splice(index, 1);
-                $scope.selectedListener.fields.splice(index, 1);
-
-                if ($scope.fields.length == 0) {
-                    $scope.selectedField = undefined;
-                }
-
-                $timeout(function () {
-                    if ($scope.fields.length > 0) {
-                        $scope.fieldGridApi.selection.toggleRowSelection($scope.fields[0]);
-                    }
-                });
-            }
-        };
-
-        // Click handler for up button
-        $scope.moveFieldUp = function () {
-            var selectedItems = $scope.fieldGridApi.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);
-                    $scope.selectedListener.fields.splice(index, 1);
-                    $timeout(function () {
-                        $scope.fields.splice(index + -1, 0, temp);
-                        $scope.selectedListener.fields.splice(index + -1, 0, temp);
-                        $timeout(function () {
-                            $scope.fieldGridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        // Click handler for down button
-        $scope.moveFieldDown = function () {
-            var selectedItems = $scope.fieldGridApi.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);
-                    $scope.selectedListener.fields.splice(index, 1);
-                    $timeout(function () {
-                        $scope.fields.splice(index + 1, 0, temp);
-                        $scope.selectedListener.fields.splice(index + 1, 0, temp);
-                        $timeout(function () {
-                            $scope.fieldGridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        // Click handler for save button
-        $scope.save = function () {
-
-            if ($scope.executionListeners.length > 0) {
-                $scope.property.value = {};
-                $scope.property.value.executionListeners = $scope.executionListeners;
-            } else {
-                $scope.property.value = null;
-            }
-
-            $scope.updatePropertyInModel($scope.property);
-            $scope.close();
-        };
-
-        $scope.cancel = function () {
-            $scope.$hide();
-            $scope.property.mode = 'read';
-        };
-
-        // Close button handler
-        $scope.close = function () {
-            $scope.$hide();
-            $scope.property.mode = 'read';
-        };
-
-    }]);

+ 0 - 206
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-fields-controller.js

@@ -1,206 +0,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.
- */
-
-/*
- * 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();
-        };
-    }]);

+ 0 - 327
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-form-properties-controller.js

@@ -1,327 +0,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.
- */
-
-/*
- * Form Properties
- */
-
-angular.module('flowableModeler').controller('FlowableFormPropertiesCtrl',
-    ['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
-
-        // Config for the modal window
-        var opts = {
-            template: 'editor-app/configuration/properties/form-properties-popup.html?version=' + Date.now(),
-            scope: $scope
-        };
-
-        // Open the dialog
-        _internalCreateModal(opts, $modal, $scope);
-    }]);
-
-angular.module('flowableModeler').controller('FlowableFormPropertiesPopupCtrl',
-    ['$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.formProperties !== undefined
-            && $scope.property.value.formProperties !== 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 happended
-            $scope.formProperties = angular.copy($scope.property.value.formProperties);
-            
-            for (var i = 0; i < $scope.formProperties.length; i++) {
-			    var formProperty = $scope.formProperties[i];
-			    if (formProperty.enumValues && formProperty.enumValues.length > 0) {
-				    for (var j = 0; j < formProperty.enumValues.length; j++) {
-					    var enumValue = formProperty.enumValues[j];
-					    if (!enumValue.id && !enumValue.name && enumValue.value) {
-						    enumValue.id = enumValue.value;
-						    enumValue.name = enumValue.value;
-					    }
-				    }
-			    }
-			}
-            
-        } else {
-            $scope.formProperties = [];
-        }
-        
-        $scope.enumValues = [];
-
-        $scope.translationsRetrieved = false;
-
-        $scope.labels = {};
-
-        var idPromise = $translate('PROPERTY.FORMPROPERTIES.ID');
-        var namePromise = $translate('PROPERTY.FORMPROPERTIES.NAME');
-        var typePromise = $translate('PROPERTY.FORMPROPERTIES.TYPE');
-
-        $q.all([idPromise, namePromise, typePromise]).then(function (results) {
-            $scope.labels.idLabel = results[0];
-            $scope.labels.nameLabel = results[1];
-            $scope.labels.typeLabel = results[2];
-            $scope.translationsRetrieved = true;
-
-            // Config for grid
-            $scope.gridOptions = {
-                data: $scope.formProperties,
-                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: 'type', displayName: $scope.labels.typeLabel}]
-            };
-            
-            $scope.enumGridOptions = {
-    		    data: $scope.enumValues,
-                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.selectedProperty = row.entity;
-                    $scope.selectedEnumValue = undefined;
-                    if ($scope.selectedProperty && $scope.selectedProperty.enumValues) {
-                        $scope.enumValues.length = 0;
-                        for (var i = 0; i < $scope.selectedProperty.enumValues.length; i++) {
-                            $scope.enumValues.push($scope.selectedProperty.enumValues[i]);
-                        }
-                    }
-                });
-            };
-            
-            $scope.enumGridOptions.onRegisterApi = function (gridApi) {
-                //set gridApi on scope
-                $scope.enumGridApi = gridApi;
-                gridApi.selection.on.rowSelectionChanged($scope, function (row) {
-                    $scope.selectedEnumValue = row.entity;
-                });
-            };
-        });
-
-        // Handler for when the value of the type dropdown changes
-        $scope.propertyTypeChanged = function () {
-
-            // Check date. If date, show date pattern
-            if ($scope.selectedProperty.type === 'date') {
-                $scope.selectedProperty.datePattern = 'MM-dd-yyyy hh:mm';
-            } else {
-                delete $scope.selectedProperty.datePattern;
-            }
-
-            // Check enum. If enum, show list of options
-            if ($scope.selectedProperty.type === 'enum') {
-                $scope.selectedProperty.enumValues = [ {id: 'value1', name: 'Value 1'}, {id: 'value2', name: 'Value 2'}];
-                $scope.enumValues.length = 0;
-                for (var i = 0; i < $scope.selectedProperty.enumValues.length; i++) {
-                    $scope.enumValues.push($scope.selectedProperty.enumValues[i]);
-                }
-                
-            } else {
-                delete $scope.selectedProperty.enumValues;
-                $scope.enumValues.length = 0;
-            }
-        };
-
-        // Click handler for add button
-        var propertyIndex = 1;
-        $scope.addNewProperty = function () {
-            var newProperty = {
-                id: 'new_property_' + propertyIndex++,
-                name: '',
-                type: 'string',
-                readable: true,
-                writable: true
-            };
-
-            $scope.formProperties.push(newProperty);
-
-            $timeout(function () {
-                $scope.gridApi.selection.toggleRowSelection(newProperty);
-            });
-        };
-
-        // Click handler for remove button
-        $scope.removeProperty = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.formProperties.indexOf(selectedItems[0]);
-                $scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
-                $scope.formProperties.splice(index, 1);
-
-                if ($scope.formProperties.length == 0) {
-                    $scope.selectedProperty = undefined;
-                }
-
-                $timeout(function() {
-                    if ($scope.formProperties.length > 0) {
-                        $scope.gridApi.selection.toggleRowSelection($scope.formProperties[0]);
-                    }
-                });
-            }
-        };
-
-        // Click handler for up button
-        $scope.movePropertyUp = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.formProperties.indexOf(selectedItems[0]);
-                if (index != 0) { // If it's the first, no moving up of course
-                    var temp = $scope.formProperties[index];
-                    $scope.formProperties.splice(index, 1);
-                    $timeout(function(){
-                        $scope.formProperties.splice(index + -1, 0, temp);
-                        $timeout(function() {
-                            $scope.gridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        // Click handler for down button
-        $scope.movePropertyDown = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.formProperties.indexOf(selectedItems[0]);
-                if (index != $scope.formProperties.length - 1) { // If it's the last element, no moving down of course
-                    var temp = $scope.formProperties[index];
-                    $scope.formProperties.splice(index, 1);
-                    $timeout(function(){
-                        $scope.formProperties.splice(index + 1, 0, temp);
-                        $timeout(function() {
-                            $scope.gridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-        
-        $scope.addNewEnumValue = function() {
-            if ($scope.selectedProperty) {
-        	    var newEnumValue = { id : '', name : ''};
-        	    $scope.selectedProperty.enumValues.push(newEnumValue);
-        	    $scope.enumValues.push(newEnumValue);
-    	       
-    	        $timeout(function () {
-                    $scope.enumGridApi.selection.toggleRowSelection(newEnumValue);
-                });
-        	}
-        };
-
-        // Click handler for remove button
-        $scope.removeEnumValue = function() {
-            var selectedItems = $scope.enumGridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.enumValues.indexOf(selectedItems[0]);
-                $scope.enumGridApi.selection.toggleRowSelection(selectedItems[0]);
-
-                $scope.enumValues.splice(index, 1);
-                $scope.selectedProperty.enumValues.splice(index, 1);
-
-                if ($scope.enumValues.length == 0) {
-                    $scope.selectedEnumValue = undefined;
-                }
-
-                $timeout(function () {
-                    if ($scope.enumValues.length > 0) {
-                        $scope.enumGridApi.selection.toggleRowSelection($scope.enumValues[0]);
-                    }
-                });
-            }
-        };
-    
-        // Click handler for up button
-        $scope.moveEnumValueUp = function() {
-            var selectedItems = $scope.enumGridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.enumValues.indexOf(selectedItems[0]);
-                if (index != 0) { // If it's the first, no moving up of course
-                    var temp = $scope.enumValues[index];
-                    $scope.enumValues.splice(index, 1);
-                    $scope.selectedProperty.enumValues.splice(index, 1);
-                    $timeout(function () {
-                        $scope.enumValues.splice(index + -1, 0, temp);
-                        $scope.selectedProperty.enumValues.splice(index + -1, 0, temp);
-                        $timeout(function () {
-                            $scope.enumGridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-    
-        // Click handler for down button
-        $scope.moveEnumValueDown = function() {
-            var selectedItems = $scope.enumGridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.enumValues.indexOf(selectedItems[0]);
-                if (index != $scope.enumValues.length - 1) { // If it's the last element, no moving down of course
-                    var temp = $scope.enumValues[index];
-                    $scope.enumValues.splice(index, 1);
-                    $scope.selectedProperty.enumValues.splice(index, 1);
-                    $timeout(function () {
-                        $scope.enumValues.splice(index + 1, 0, temp);
-                        $scope.selectedProperty.enumValues.splice(index + 1, 0, temp);
-                        $timeout(function () {
-                            $scope.enumGridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        // Click handler for save button
-        $scope.save = function () {
-
-            if ($scope.formProperties.length > 0) {
-                $scope.property.value = {};
-                $scope.property.value.formProperties = $scope.formProperties;
-            } else {
-                $scope.property.value = null;
-            }
-
-            $scope.updatePropertyInModel($scope.property);
-            $scope.close();
-        };
-
-        $scope.cancel = function () {
-            $scope.$hide();
-            $scope.property.mode = 'read';
-        };
-
-        // Close button handler
-        $scope.close = function () {
-            $scope.$hide();
-            $scope.property.mode = 'read';
-        };
-
-    }])
-;

+ 0 - 261
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-form-reference-controller.js

@@ -1,261 +0,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.
- */
- 
-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.CONFIG.contextRoot + '/app/rest/models/' + $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.CONFIG.contextRoot + '/app/rest/models', 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.CONFIG.contextRoot + '/app/rest/form-models')
-            .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();
-}]);

+ 0 - 179
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-in-parameters-controller.js

@@ -1,179 +0,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.
- */
-
-/*
- * 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');
-
-        $q.all([sourcePromise, sourceExpressionPromise, targetPromise]).then(function (results) {
-            $scope.labels.sourceLabel = results[0];
-            $scope.labels.sourceExpressionLabel = results[1];
-            $scope.labels.targetLabel = results[2];
-            $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}]
-            };
-
-            $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: ''
-            };
-
-            $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();
-        };
-
-    }]);

+ 0 - 41
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-message-scope-controller.js

@@ -1,41 +0,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.
- */
-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);
-    };
-}]);

+ 0 - 28
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-multiinstance-controller.js

@@ -1,28 +0,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.
- */
-
-/*
- * Execution listeners
- */
-
-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);
-    };
-}]);

+ 0 - 28
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-ordering-controller.js

@@ -1,28 +0,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.
- */
-
-/*
- * 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);
-    };
-}]);

+ 0 - 176
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-out-parameters-controller.js

@@ -1,176 +0,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.
- */
-
-/*
- * 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');
-
-        $q.all([sourcePromise, sourceExpressionPromise, targetPromise]).then(function (results) {
-            $scope.labels.sourceLabel = results[0];
-            $scope.labels.sourceExpressionLabel = results[1];
-            $scope.labels.targetLabel = results[2];
-            $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}]
-            };
-
-            $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: ''};
-
-            $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();
-        };
-
-    }]);

+ 0 - 42
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-signal-scope-controller.js

@@ -1,42 +0,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.
- */
-
-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);
-    };
-}]);

+ 0 - 356
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties-task-listeners-controller.js

@@ -1,356 +0,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.
- */
-
-/*
- * Task listeners
- */
-
-angular.module('flowableModeler').controller('FlowableTaskListenersCtrl',
-    ['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
-
-        // Config for the modal window
-        var opts = {
-            template: 'editor-app/configuration/properties/task-listeners-popup.html?version=' + Date.now(),
-            scope: $scope
-        };
-
-        // Open the dialog
-        _internalCreateModal(opts, $modal, $scope);
-    }]);
-
-angular.module('flowableModeler').controller('FlowableTaskListenersPopupCtrl',
-    ['$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.taskListeners !== undefined
-            && $scope.property.value.taskListeners !== null) {
-
-            if ($scope.property.value.taskListeners.constructor == String) {
-                $scope.taskListeners = JSON.parse($scope.property.value.taskListeners);
-            }
-            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.taskListeners = angular.copy($scope.property.value.taskListeners);
-            }
-
-            for (var i = 0; i < $scope.taskListeners.length; i++) {
-                var taskListener = $scope.taskListeners[i];
-                if (taskListener.className !== undefined && taskListener.className !== '') {
-                    taskListener.implementation = taskListener.className;
-                }
-                else if (taskListener.expression !== undefined && taskListener.expression !== '') {
-                    taskListener.implementation = taskListener.expression;
-                }
-                else if (taskListener.delegateExpression !== undefined && taskListener.delegateExpression !== '') {
-                    taskListener.implementation = taskListener.delegateExpression;
-                }
-            }
-        } else {
-            $scope.taskListeners = [];
-        }
-
-        $scope.selectedListener = undefined;
-        $scope.selectedField = undefined;
-        $scope.fields = [];
-        $scope.translationsRetrieved = false;
-
-        $scope.labels = {};
-
-        var eventPromise = $translate('PROPERTY.TASKLISTENERS.EVENT');
-        var implementationPromise = $translate('PROPERTY.TASKLISTENERS.FIELDS.IMPLEMENTATION');
-        var namePromise = $translate('PROPERTY.TASKLISTENERS.FIELDS.NAME');
-
-        $q.all([eventPromise, implementationPromise, namePromise]).then(function (results) {
-            $scope.labels.eventLabel = results[0];
-            $scope.labels.implementationLabel = results[1];
-            $scope.labels.nameLabel = results[2];
-            $scope.translationsRetrieved = true;
-
-            // Config for grid
-            $scope.gridOptions = {
-                data: $scope.taskListeners,
-                headerRowHeight: 28,
-                enableRowSelection: true,
-                enableRowHeaderSelection: false,
-                multiSelect: false,
-                modifierKeysToMultiSelect: false,
-                enableHorizontalScrollbar: 0,
-                enableColumnMenus: false,
-                enableSorting: false,
-                columnDefs: [{field: 'event', displayName: $scope.labels.eventLabel},
-                    {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.selectedListener = row.entity;
-                    $scope.selectedField = undefined;
-                    if ($scope.selectedListener) {
-                        var fields = $scope.selectedListener.fields;
-                        if (fields !== undefined && fields !== null) {
-                            for (var i = 0; i < fields.length; i++) {
-                                var field = 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.selectedListener.fields = [];
-                        }
-
-                        $scope.fields.length = 0;
-                        for (var i = 0; i < $scope.selectedListener.fields.length; i++) {
-                            $scope.fields.push($scope.selectedListener.fields[i]);
-                        }
-                    }
-                });
-            };
-
-            // Config for field grid
-            $scope.gridFieldOptions = {
-                data: $scope.fields,
-                headerRowHeight: 28,
-                enableRowSelection: true,
-                enableRowHeaderSelection: false,
-                multiSelect: false,
-                modifierKeysToMultiSelect: false,
-                columnDefs: [{field: 'name', displayName: $scope.labels.name},
-                    {field: 'implementation', displayName: $scope.labels.implementationLabel}]
-            };
-
-            $scope.gridFieldOptions.onRegisterApi = function (gridApi) {
-                // set gridApi on scope
-                $scope.fieldGridApi = gridApi;
-                gridApi.selection.on.rowSelectionChanged($scope, function (row) {
-                    $scope.selectedField = row.entity;
-                });
-            };
-        });
-
-        $scope.listenerDetailsChanged = function () {
-            if ($scope.selectedListener.className !== '') {
-                $scope.selectedListener.implementation = $scope.selectedListener.className;
-            } else if ($scope.selectedListener.expression !== '') {
-                $scope.selectedListener.implementation = $scope.selectedListener.expression;
-            } else if ($scope.selectedListener.delegateExpression !== '') {
-                $scope.selectedListener.implementation = $scope.selectedListener.delegateExpression;
-            } else {
-                $scope.selectedListener.implementation = '';
-            }
-        };
-
-        // Click handler for add button
-        $scope.addNewListener = function () {
-            var newListener = {
-                event: 'create',
-                implementation: '',
-                className: '',
-                expression: '',
-                delegateExpression: ''
-            };
-            $scope.taskListeners.push(newListener);
-
-            $timeout(function () {
-                $scope.gridApi.selection.toggleRowSelection(newListener);
-            });
-        };
-
-        // Click handler for remove button
-        $scope.removeListener = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.taskListeners.indexOf(selectedItems[0]);
-                $scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
-
-                $scope.taskListeners.splice(index, 1);
-
-                if ($scope.taskListeners.length == 0) {
-                    $scope.selectedListener = undefined;
-                }
-
-                $timeout(function () {
-                    if ($scope.taskListeners.length > 0) {
-                        $scope.gridApi.selection.toggleRowSelection($scope.taskListeners[0]);
-                    }
-                });
-            }
-        };
-
-        // Click handler for up button
-        $scope.moveListenerUp = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.taskListeners.indexOf(selectedItems[0]);
-                if (index != 0) { // If it's the first, no moving up of course
-                    var temp = $scope.taskListeners[index];
-                    $scope.taskListeners.splice(index, 1);
-                    $timeout(function () {
-                        $scope.taskListeners.splice(index + -1, 0, temp);
-                        $timeout(function () {
-                            $scope.gridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        // Click handler for down button
-        $scope.moveListenerDown = function () {
-            var selectedItems = $scope.gridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.taskListeners.indexOf(selectedItems[0]);
-                if (index != $scope.taskListeners.length - 1) { // If it's the last element, no moving down of course
-                    var temp = $scope.taskListeners[index];
-                    $scope.taskListeners.splice(index, 1);
-                    $timeout(function () {
-                        $scope.taskListeners.splice(index + 1, 0, temp);
-                        $timeout(function () {
-                            $scope.gridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-
-                }
-            }
-        };
-
-        $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 () {
-            if ($scope.selectedListener) {
-                if ($scope.selectedListener.fields == undefined) {
-                    $scope.selectedListener.fields = [];
-                }
-
-                var newField = {
-                    name: 'fieldName',
-                    implementation: '',
-                    stringValue: '',
-                    expression: '',
-                    string: ''
-                };
-                $scope.fields.push(newField);
-                $scope.selectedListener.fields.push(newField);
-
-                $timeout(function () {
-                    $scope.fieldGridApi.selection.toggleRowSelection(newField);
-                });
-            }
-        };
-
-        // Click handler for remove button
-        $scope.removeField = function () {
-            var selectedItems = $scope.fieldGridApi.selection.getSelectedRows();
-            if (selectedItems && selectedItems.length > 0) {
-                var index = $scope.fields.indexOf(selectedItems[0]);
-                $scope.fieldGridApi.selection.toggleRowSelection(selectedItems[0]);
-
-                $scope.fields.splice(index, 1);
-                $scope.selectedListener.fields.splice(index, 1);
-
-                if ($scope.fields.length == 0) {
-                    $scope.selectedField = undefined;
-                }
-
-                $timeout(function () {
-                    if ($scope.fields.length > 0) {
-                        $scope.fieldGridApi.selection.toggleRowSelection($scope.fields[0]);
-                    }
-                });
-            }
-        };
-
-        // Click handler for up button
-        $scope.moveFieldUp = function () {
-            var selectedItems = $scope.fieldGridApi.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);
-                    $scope.selectedListener.fields.splice(index, 1);
-                    $timeout(function () {
-                        $scope.fields.splice(index + -1, 0, temp);
-                        $scope.selectedListener.fields.splice(index + -1, 0, temp);
-                        $timeout(function () {
-                            $scope.fieldGridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-
-                }
-            }
-        };
-
-        // Click handler for down button
-        $scope.moveFieldDown = function () {
-            var selectedItems = $scope.fieldGridApi.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);
-                    $scope.selectedListeners.fields.splice(index, 1);
-                    $timeout(function () {
-                        $scope.fields.splice(index + 1, 0, temp);
-                        $scope.selectedListener.fields.splice(index + 1, 0, temp);
-                        $timeout(function () {
-                            $scope.fieldGridApi.selection.toggleRowSelection(temp);
-                        });
-                    });
-                }
-            }
-        };
-
-        // Click handler for save button
-        $scope.save = function () {
-
-            if ($scope.taskListeners.length > 0) {
-                $scope.property.value = {};
-                $scope.property.value.taskListeners = $scope.taskListeners;
-            } 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();
-        };
-
-    }]);

File diff suppressed because it is too large
+ 0 - 15
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/assignment-display-template.html


+ 0 - 268
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/assignment-popup.html

@@ -1,268 +0,0 @@
-<div class="modal" ng-controller="FlowableAssignmentPopupCtrl">
-    <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.ASSIGNMENT.TITLE</h2>
-            </div>
-            <div class="modal-body">
-                <div class="detail-group clearfix">
-
-                    <div class="form-group clearfix">
-                        <div class="col-xs-12">
-                            <label class="col-xs-4">{{'PROPERTY.ASSIGNMENT.TYPE' | translate}}</label>
-
-                            <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="popup.assignmentObject.type = 'idm'"
-                                                ng-model="popup.assignmentObject.type" ng-class="{'active' : popup.assignmentObject.type == 'idm'}">
-                                            {{'PROPERTY.ASSIGNMENT.TYPE.IDENTITYSTORE' | translate}}
-                                        </button>
-                                    </div>
-                                    <div class="btn-group">
-                                        <button type="button" class="btn btn-default" ng-click="popup.assignmentObject.type = 'static'"
-                                                ng-model="popup.assignmentObject.type" ng-class="{'active' : popup.assignmentObject.type != 'idm'}">
-                                            {{'PROPERTY.ASSIGNMENT.TYPE.STATIC' | translate}}
-                                        </button>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix" ng-show="popup.assignmentObject.type != 'idm'">
-                        <div class="col-xs-12">
-                            <label>{{'PROPERTY.ASSIGNMENT.ASSIGNEE' | translate}}</label>
-                        </div>
-                        <div class="col-xs-12">
-                            <input type="text" id="assigneeField" class="form-control" ng-model="popup.assignmentObject.static.assignee"
-                                   placeholder="{{'PROPERTY.ASSIGNMENT.ASSIGNEE_PLACEHOLDER' | translate}}"/>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix" ng-show="popup.assignmentObject.type != 'idm'">
-                        <div class="col-xs-12">
-                            <label>{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS' | translate}}</label>
-                        </div>
-                        <div class="col-xs-12" ng-repeat="candidateUser in popup.assignmentObject.static.candidateUsers">
-                            <input id="userField" class="form-control" type="text" ng-model="candidateUser.value"/>
-                            <i ng-if="popup.assignmentObject.static.candidateUsers.length >1" class="glyphicon glyphicon-minus clickable-property"
-                               ng-click="removeCandidateUserValue($index)"></i>
-                            <i ng-if="$index == (popup.assignmentObject.static.candidateUsers.length - 1)" class="glyphicon glyphicon-plus clickable-property"
-                               ng-click="addCandidateUserValue($index)"></i>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix" ng-show="popup.assignmentObject.type != 'idm'">
-                        <div class="col-xs-12">
-                            <label>{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS' | translate}}</label>
-                        </div>
-                        <div class="col-xs-12" ng-repeat="candidateGroup in popup.assignmentObject.static.candidateGroups">
-                            <input id="groupField" class="form-control" type="text" ng-model="candidateGroup.value"/>
-                            <i ng-if="popup.assignmentObject.static.candidateGroups.length >1" class="glyphicon glyphicon-minus clickable-property"
-                               ng-click="removeCandidateGroupValue($index)"></i>
-                            <i ng-if="$index == (popup.assignmentObject.static.candidateGroups.length - 1)" class="glyphicon glyphicon-plus clickable-property"
-                               ng-click="addCandidateGroupValue($index)"></i>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix" ng-show="popup.assignmentObject.type == 'idm'">
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label>{{'PROPERTY.ASSIGNMENT.IDM.TYPE' | translate}}</label>
-                            </div>
-                            <div class="col-xs-8">
-                                <div class="btn-group span">
-                                    <button class="selection" ng-options="option as (option.title | translate) for option in assignmentOptions"
-                                            bs-select ng-model="assignmentOption" activiti-fix-dropdown-bug>
-                                    </button>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix" ng-show="popup.assignmentObject.type == 'idm' && assignmentOption.id == 'users'">
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label>{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS' | translate}}</label>
-                            </div>
-                            <div class="col-xs-8 clearfix">
-                                <ul class="simple-list"
-                                    ng-show="popup.assignmentObject.idm.candidateUsers.length || popup.assignmentObject.idm.candidateUserFields.length">
-                                    <li ng-repeat="user in popup.assignmentObject.idm.candidateUsers">
-                                        <i class="icon icon-user"></i>
-                                        <span user-name="user"></span>
-
-                                        <div class="actions">
-                                            <a ng-click="removeCandidateUser(user)"><i class="icon icon-remove"></i></a>
-                                        </div>
-                                    </li>
-                                    <li ng-repeat="userField in popup.assignmentObject.idm.candidateUserFields">
-                                        <i class="icon icon-user"></i>
-                                        <span>{{userField.name}}</span>
-                                        <span class="field-type"> - {{userFieldField.id}}</span>
-
-                                        <div class="actions">
-                                            <a ng-click="removeCandidateUserField(userField)"><i class="icon icon-remove"></i></a>
-                                        </div>
-                                    </li>
-                                </ul>
-                                <div class="no-results"
-                                     ng-if="(!popup.assignmentObject.idm.candidateUsers || !popup.assignmentObject.idm.candidateUsers.length) && (!popup.assignmentObject.idm.candidateUserFields || !popup.assignmentObject.idm.candidateUserFields.length)">
-                                    {{'PROPERTY.ASSIGNMENT.IDM.NO_CANDIDATE_USERS' | translate}}
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix" ng-show="popup.assignmentObject.type == 'idm' && assignmentOption.id == 'groups'">
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label>{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS' | translate}}</label>
-                            </div>
-                            <div class="col-xs-8 clearfix">
-                                <ul class="simple-list"
-                                    ng-show="popup.assignmentObject.idm.candidateGroups.length || popup.assignmentObject.idm.candidateGroupFields.length">
-                                    <li ng-repeat="group in popup.assignmentObject.idm.candidateGroups">
-                                        {{group.name}}
-                                        <div class="actions">
-                                            <a ng-click="removeCandidateGroup(group)"><i class="icon icon-remove"></i></a>
-                                        </div>
-                                    </li>
-                                    <li ng-repeat="groupField in popup.assignmentObject.idm.candidateGroupFields">
-                                        {{groupField.name}}
-                                        <div class="actions">
-                                            <a ng-click="removeCandidateGroupField(groupField)"><i class="icon icon-remove"></i></a>
-                                        </div>
-                                    </li>
-                                </ul>
-                                <div class="no-results"
-                                     ng-if="(!popup.assignmentObject.idm.candidateGroups || !popup.assignmentObject.idm.candidateGroups.length) && (!popup.assignmentObject.idm.candidateGroupFields || !popup.assignmentObject.idm.candidateGroupFields.length)">
-                                    {{'PROPERTY.ASSIGNMENT.IDM.NO_CANDIDATE_GROUPS' | translate}}
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix" ng-show="popup.assignmentObject.type == 'idm' && assignmentOption.id == 'user'">
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label>{{'PROPERTY.ASSIGNMENT.ASSIGNEE' | translate}}</label>
-                            </div>
-                            <div class="col-xs-8">
-                                <label ng-if="!popup.assignmentObject.idm.assignee && !popup.assignmentObject.idm.assigneeField">{{'PROPERTY.ASSIGNMENT.NONE' | translate}}</label>
-                                <ul class="simple-list" ng-if="popup.assignmentObject.idm.assignee || popup.assignmentObject.idm.assigneeField">
-                                    <li>
-                                        <i class="icon icon-user"></i>
-                                        <span ng-if="popup.assignmentObject.idm.assignee" user-name="popup.assignmentObject.idm.assignee"></span>
-                                        <span ng-if="popup.assignmentObject.idm.assigneeField">{{popup.assignmentObject.idm.assigneeField.name}}</span>
-                                        <span ng-if="popup.assignmentObject.idm.assigneeField"
-                                              class="field-type"> - {{popup.assignmentObject.idm.assigneeField.id}}</span>
-
-                                        <div class="actions" ng-if="popup.assignmentObject.idm.assignee || popup.assignmentObject.idm.assigneeField">
-                                            <a ng-click="removeAssignee()"><i class="icon icon-remove"></i></a>
-                                        </div>
-                                    </li>
-                                </ul>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix"
-                         ng-if="popup.assignmentObject.type == 'idm' && (!popup.assignmentObject.assignmentSourceType || popup.assignmentObject.assignmentSourceType == 'search') && (assignmentOption.id == 'user' || assignmentOption.id == 'users')">
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label>{{'PROPERTY.ASSIGNMENT.SEARCH' | translate}}</label>
-                            </div>
-                            <div class="col-xs-8">
-                                <input class="form-control" type="text" id="people-select-input" placeholder="{{'PROPERTY.ASSIGNMENT.PLACEHOLDER-SEARCHUSER' | translate}}" auto-focus custom-keys
-                                       up-pressed="previousUser()" down-pressed="nextUser()" enter-pressed="confirmUser()" delayed-model="popup.filter" delay="200"/>
-                            </div>
-                        </div>
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label></label>
-                            </div>
-                            <div class="col-xs-8">
-                                <div class="subtle" style="margin: 2px 0 2px 0">
-                                    <span translate="PROPERTY.ASSIGNMENT.MATCHING"></span>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label></label>
-                            </div>
-                            <div class="col-xs-8">
-                                <div class="inline-people-select">
-                                    <ul class="simple-list">
-                                        <li ng-click="confirmUser(user)" ng-repeat="user in popup.userResults" ng-class="{'active': $index == popup.selectedIndex}">
-                                            <div user-picture="user" user-index="$index" user-name="user"></div>
-                                        </li>
-                                    </ul>
-                                    <div class="nothing-to-see" translate="GENERAL.MESSAGE.PEOPLE-NO-MATCHING-RESULTS" ng-show="popup.userResults.length == 0"></div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix"
-                         ng-if="popup.assignmentObject.type == 'idm' && (!popup.assignmentObject.assignmentSourceType || popup.assignmentObject.assignmentSourceType == 'search') && assignmentOption.id == 'groups'">
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label>{{'PROPERTY.ASSIGNMENT.SEARCH' | translate}}</label>
-                            </div>
-                            <div class="col-xs-8">
-                                <input class="form-control" type="text" id="people-select-input" placeholder="{{'PROPERTY.ASSIGNMENT.PLACEHOLDER-SEARCHGROUP' | translate}}" auto-focus custom-keys
-                                       up-pressed="previousGroup()" down-pressed="nextGroup()" enter-pressed="confirmGroup()" delayed-model="popup.groupFilter"
-                                       delay="200"/>
-                            </div>
-                        </div>
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label></label>
-                            </div>
-                            <div class="col-xs-8">
-                                <div class="subtle">
-                                    <span translate="PROPERTY.ASSIGNMENT.MATCHING"></span>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="col-xs-12">
-                            <div class="col-xs-4">
-                                <label></label>
-                            </div>
-                            <div class="col-xs-8">
-                                <div class="inline-people-select">
-                                    <ul class="simple-list">
-                                        <li ng-click="confirmGroup(group);" ng-repeat="group in popup.groupResults"
-                                            ng-class="{'active': $index == popup.selectedGroupIndex}">
-                                            {{group.name}}
-                                        </li>
-                                    </ul>
-                                    <div class="nothing-to-see" translate="GENERAL.MESSAGE.GROUP-NO-MATCHING-RESULTS" ng-show="popup.groupResults.length == 0"></div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="form-group clearfix">
-                        <div class="col-xs-12">
-                            <div class="col-xs-12">
-                                <label>
-                                    <input type="checkbox" ng-model="assignment.initiatorCanCompleteTask">
-                                    &nbsp;{{'PROPERTY.ASSIGNMENT.INITIATOR-CAN-COMPLETE' | translate}}
-                                </label>
-                            </div>
-                        </div>
-                    </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>

+ 0 - 3
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/condition-expression-display-template.html

@@ -1,3 +0,0 @@
-<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>

+ 0 - 74
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/decisiontable-reference-popup.html

@@ -1,74 +0,0 @@
-
-<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="{{config.contextRoot}}/app/rest/models/{{decisionTable.id}}/thumbnail" />
-                         </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>

+ 0 - 2
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/decisiontable-reference-write-template.html

@@ -1,2 +0,0 @@
-<span ng-controller="FlowableDecisionTableReferenceCtrl">
-</span>

+ 0 - 6
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/duedate-display-template.html

@@ -1,6 +0,0 @@
-
-<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>

+ 0 - 120
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/duedate-popup.html

@@ -1,120 +0,0 @@
-
-<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>

+ 0 - 5
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/errorgrid-critical.html

@@ -1,5 +0,0 @@
-<div class="ui-grid-cell-contents flowable-status">
-	<!-- we inverse the logic here. A false warning is critical. A true warning is a warning -->
-	<div class="flowable-warning" ng-if="row.entity.warning">Warning</div>
-	<div class="flowable-critical" ng-if="!row.entity.warning">Critical</div>
-</div>

+ 0 - 119
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/event-listeners-popup.html

@@ -1,119 +0,0 @@
-
-<div class="modal" ng-controller="FlowableEventListenersPopupCtrl">
-    <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-10">
-            	        <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="moveListenerUp()"><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="moveListenerDown()"><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="addNewListener()"><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="removeListener()"><i class="glyphicon glyphicon-minus"></i></a>
-            	            </div>
-            	        </div>
-            		</div>
-            	</div>
-
-            	<div class="row row-no-gutter">
-                  <div ng-if="translationsRetrieved" ng-show="selectedListener" class="col-xs-6">
-                    <div class="form-group">
-            	        	<label>{{'PROPERTY.EVENTLISTENERS.EVENTS' | translate}}</label>
-            	            <div ng-repeat="eventDefinition in selectedListener.events">
-            	            	  <select id="eventField" class="form-control" ng-model="eventDefinition.event" ng-change="listenerDetailsChanged()"
-                                          style="display:inline-block; width:80%;margin-bottom: 10px;">
-                                  <option title="{{'EVENT_TYPE.ACTIVITY.COMPENSATE.TOOLTIP' | translate}}">ACTIVITY_COMPENSATE</option>
-                                  <option title="{{'EVENT_TYPE.ACTIVITY.COMPLETED.TOOLTIP' | translate}}">ACTIVITY_COMPLETED</option>
-                                  <option title="bla">ACTIVITY_ERROR_RECEIVED</option>
-                                  <option>ACTIVITY_MESSAGE_RECEIVED</option>
-                                  <option>ACTIVITY_SIGNALED</option>
-                                  <option>ACTIVITY_STARTED</option>
-                                  <option>ENGINE_CLOSED</option>
-                                  <option>ENGINE_CREATED</option>
-                                  <option>ENTITY_ACTIVATED</option>
-                                  <option>ENTITY_CREATED</option>
-                                  <option>ENTITY_DELETED</option>
-                                  <option>ENTITY_INITIALIZED</option>
-                                  <option>ENTITY_SUSPENDED</option>
-                                  <option>ENTITY_UPDATED</option>
-                                  <option>JOB_EXECUTION_FAILURE</option>
-                                  <option>JOB_EXECUTION_SUCCESS</option>
-                                  <option>JOB_RETRIES_DECREMENTED</option>
-                                  <option title="{{'EVENT_TYPE.MEMBERSHIP.CREATED.TOOLTIP' | translate}}">MEMBERSHIP_CREATED</option>
-                                  <option title="{{'EVENT_TYPE.MEMBERSHIP.DELETED.TOOLTIP' | translate}}">MEMBERSHIP_DELETED</option>
-                                  <option title="{{'EVENT_TYPE.MEMBERSHIPS.DELETED.TOOLTIP' | translate}}">MEMBERSHIPS_DELETED</option>
-                                  <option title="{{'EVENT_TYPE.TASK.ASSIGNED.TOOLTIP' | translate}}">TASK_ASSIGNED</option>
-                                  <option title="{{'EVENT_TYPE.TASK.COMPLETED.TOOLTIP' | translate}}">TASK_COMPLETED</option>
-                                  <option>TIMER_FIRED</option>
-                                  <option title="{{'EVENT_TYPE.UNCAUGHT.BPMNERROR.TOOLTIP' | translate}}">UNCAUGHT_BPMN_ERROR</option>
-                                  <option title="{{'EVENT_TYPE.VARIABLE.CREATED.TOOLTIP' | translate}}">VARIABLE_CREATED</option>
-                                  <option title="{{'EVENT_TYPE.VARIABLE.DELETED.TOOLTIP' | translate}}">VARIABLE_DELETED</option>
-                                  <option title="{{'EVENT_TYPE.VARIABLE.UPDATED.TOOLTIP' | translate}}">VARIABLE_UPDATED</option>
-            	               	</select>
-            		            <i ng-if="$index > 0" class="glyphicon glyphicon-minus clickable-property" ng-click="removeEventValue($index)"
-                                   style="margin: 5px 0 5px 10px; font-size: 16px; cursor:pointer;"></i>
-            		            <i class="glyphicon glyphicon-plus clickable-property" ng-click="addEventValue($index)"
-                                   style="margin: 5px 0 5px 10px; font-size: 16px; cursor:pointer;"></i>
-            	            </div>
-
-            	            <div class="form-group" ng-show="selectedListener.event" style="margin-top: 10px;">
-                                <input type="checkbox" id="rethrowField" class="checkbox" ng-model="selectedListener.rethrowEvent" ng-change="listenerDetailsChanged()" style="display:inline-block;"/>
-                                <label for="classField" ng-click="selectedListener.rethrowEvent = !selectedListener.rethrowEvent" style="cursor:pointer;">{{'PROPERTY.EVENTLISTENERS.RETHROW' | translate}}</label>
-                            </div>
-            	       	  </div>
-                     </div>
-                     <div ng-show="selectedListener && selectedListener.events[0].event" class="col-xs-6">
-                     	<div class="form-group" ng-if="!selectedListener.rethrowEvent">
-            		   		<label for="classField"> {{'PROPERTY.EVENTLISTENERS.CLASS' | translate}}</label>
-            		   		<input type="text" id="classField" class="form-control" ng-model="selectedListener.className" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.CLASS.PLACEHOLDER' | translate}}" />
-            			</div>
-            			<div class="form-group" ng-if="!selectedListener.rethrowEvent">
-            		   		<label for="delegateExpressionField">{{'PROPERTY.EVENTLISTENERS.DELEGATEEXPRESSION' | translate}}</label>
-            		   		<input type="text" id="delegateExpressionField" class="form-control" ng-model="selectedListener.delegateExpression" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.DELEGATEEXPRESSION.PLACEHOLDER' | translate}}" />
-            			</div>
-            			<div class="form-group" ng-if="!selectedListener.rethrowEvent">
-            		   		<label for="entityTypeField">{{'PROPERTY.EVENTLISTENERS.ENTITYTYPE' | translate}}</label>
-            		   		<input type="text" id="entityTypeField" class="form-control" ng-model="selectedListener.entityType" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.ENTITYTYPE.PLACEHOLDER' | translate}}" />
-            			</div>
-            			<div class="form-group" ng-if="selectedListener.rethrowEvent">
-            		   		<label for="delegateExpressionField">{{'PROPERTY.EVENTLISTENERS.RETHROWTYPE' | translate}}</label>
-            		   		<select id="rethrowTypeField" class="form-control" ng-model="selectedListener.rethrowType" ng-change="rethrowTypeChanged()">
-                                <option>error</option>
-                                <option>message</option>
-                                <option>signal</option>
-                                <option>globalSignal</option>
-                            </select>
-            			</div>
-            			<div class="form-group" ng-if="selectedListener.rethrowEvent && selectedListener.rethrowType === 'error'">
-            		   		<label for="errorCodeField">{{'PROPERTY.EVENTLISTENERS.ERRORCODE' | translate}}</label>
-            		   		<input type="text" id="errorCodeField" class="form-control" ng-model="selectedListener.errorcode" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.ERRORCODE.PLACEHOLDER' | translate}}" />
-            			</div>
-            			<div class="form-group" ng-if="selectedListener.rethrowEvent && selectedListener.rethrowType === 'message'">
-            		   		<label for="messageNameField">{{'PROPERTY.EVENTLISTENERS.MESSAGENAME' | translate}}</label>
-            		   		<input type="text" id="messageNameField" class="form-control" ng-model="selectedListener.messagename" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.MESSAGENAME.PLACEHOLDER' | translate}}" />
-            			</div>
-            			<div class="form-group" ng-if="selectedListener.rethrowEvent && (selectedListener.rethrowType === 'signal' || selectedListener.rethrowType === 'globalSignal')">
-            		   		<label for="messageNameField">{{'PROPERTY.EVENTLISTENERS.SIGNALNAME' | translate}}</label>
-            		   		<input type="text" id="signalNameField" class="form-control" ng-model="selectedListener.signalname" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.SIGNALNAME.PLACEHOLDER' | translate}}" />
-            			</div>
-                     </div>
-                     <div ng-show="!selectedListener" class="col-xs-6 muted no-property-selected" translate>PROPERTY.EVENTLISTENERS.UNSELECTED</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>

+ 0 - 4
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/execution-listeners-write-template.html

@@ -1,4 +0,0 @@
-
-<!-- Just need to instantiate the controller, and it will take care of showing the modal dialog -->
-<span ng-controller="FlowableExecutionListenersCtrl">
-</span>

+ 0 - 58
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/main/resources/static/workflow/modeler/editor/editor-app/configuration/properties/fields-popup.html

@@ -1,58 +0,0 @@
-
-<div class="modal" ng-controller="FlowableFieldsPopupCtrl">
-    <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>
-			    <h3>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate}} "{{property.title | translate}}"</h3>
-			</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="moveFieldUp()"><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="moveFieldDown()"><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="addNewField()"><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="removeField()"><i class="glyphicon glyphicon-minus"></i></a>
-			                </div>
-			            </div>
-			        </div>
-
-			        <div class="col-xs-6">
-			             <div ng-show="selectedField">
-
-			                 <div class="form-group">
-			                     <label translate>PROPERTY.FIELDS.NAME</label>
-			                     <input type="text" class="form-control" ng-model="selectedField.name" placeholder="{{'PROPERTY.FIELDS.NAME.PLACEHOLDER' | translate}}" />
-			                 </div>
-			                 <div>
-			                     <label translate>PROPERTY.FIELDS.STRINGVALUE</label>
-			                     <input type="text" class="form-control" ng-model="selectedField.stringValue" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.FIELDS.STRINGVALUE.PLACEHOLDER' | translate}}" />
-			                 </div>
-			                 <div>
-			                     <label translate>PROPERTY.FIELDS.EXPRESSION</label>
-			                     <input type="text" class="form-control" ng-model="selectedField.expression" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.FIELDS.EXPRESSION.PLACEHOLDER' | translate}}" />
-			                 </div>
-			                 <div>
-			                     <label translate>PROPERTY.FIELDS.STRING</label>
-			                     <textarea type="text" class="form-control" ng-model="selectedField.string" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.FIELDS.STRING.PLACEHOLDER' | translate}}"></textarea>
-			                 </div>
-
-			            </div>
-			            <div ng-show="!selectedField" class="muted no-property-selected" translate>PROPERTY.FIELDS.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>

+ 1 - 0
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/test/resources/application.yml

@@ -14,5 +14,6 @@ spring:
 logging:
   level:
       org.flowable: debug
+      org.activiti: debug
 mybatis:
   dynamic-datasource: false

File diff suppressed because it is too large
+ 76 - 0
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable-modeler/src/test/resources/processes/SimpleProcess.bpmn20.xml


+ 0 - 11
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/pom.xml

@@ -17,12 +17,6 @@
             <groupId>org.flowable</groupId>
             <artifactId>flowable-spring-boot-starter-basic</artifactId>
             <version>${flowable.version}</version>
-            <exclusions>
-                <exclusion>
-                    <artifactId>log4j</artifactId>
-                    <groupId>log4j</groupId>
-                </exclusion>
-            </exclusions>
         </dependency>
 
         <dependency>
@@ -86,11 +80,6 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-authorization-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.hswebframework.web</groupId>
             <artifactId>hsweb-commons-entity</artifactId>

+ 289 - 289
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/controller/BpmDeploymentController.java

@@ -1,289 +1,289 @@
-package org.hswebframework.web.workflow.flowable.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import org.activiti.bpmn.converter.BpmnXMLConverter;
-import org.activiti.bpmn.model.BpmnModel;
-import org.activiti.editor.constants.ModelDataJsonConstants;
-import org.activiti.editor.language.json.converter.BpmnJsonConverter;
-import org.activiti.engine.history.HistoricProcessInstance;
-import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
-import org.activiti.engine.impl.pvm.process.ActivityImpl;
-import org.activiti.engine.repository.DeploymentBuilder;
-import org.activiti.engine.repository.Model;
-import org.activiti.engine.repository.ProcessDefinition;
-import org.activiti.engine.repository.ProcessDefinitionQuery;
-import org.apache.commons.io.FilenameUtils;
-import org.hsweb.ezorm.core.PropertyWrapper;
-import org.hsweb.ezorm.core.SimplePropertyWrapper;
-import org.hsweb.ezorm.core.param.TermType;
-import org.hswebframework.web.commons.entity.PagerResult;
-import org.hswebframework.web.commons.entity.param.QueryParamEntity;
-import org.hswebframework.web.controller.message.ResponseMessage;
-import org.hswebframework.web.workflow.flowable.service.BpmActivityService;
-import org.hswebframework.web.workflow.flowable.service.BpmProcessService;
-import org.hswebframework.web.workflow.flowable.service.BpmTaskService;
-import org.hswebframework.web.workflow.flowable.utils.FlowableAbstract;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.List;
-import java.util.zip.ZipInputStream;
-
-/**
- * @Author wangwei
- * @Date 2017/7/31.
- */
-@RestController
-@RequestMapping("/workflow/definition")
-public class BpmDeploymentController extends FlowableAbstract {
-
-    protected Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    BpmTaskService bpmTaskService;
-
-    @Autowired
-    BpmProcessService bpmProcessService;
-    @Autowired
-    BpmActivityService bpmActivityService;
-
-    /**
-     * 流程定义列表
-     */
-    @GetMapping("/list")
-    public ResponseMessage<PagerResult<ProcessDefinition>> processList(QueryParamEntity param) {
-        ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
-        param.getTerms().forEach((term) -> {
-
-            PropertyWrapper valueWrapper = new SimplePropertyWrapper(term.getValue());
-            String stringValue = valueWrapper.toString();
-            switch (term.getColumn()) {
-                case "name":
-                    if (term.getTermType().equals(TermType.like)) {
-                        processDefinitionQuery.processDefinitionNameLike(stringValue);
-                    } else
-                        processDefinitionQuery.processDefinitionName(stringValue);
-                    break;
-                case "key":
-                    if (term.getTermType().equals(TermType.like)) {
-                        processDefinitionQuery.processDefinitionKeyLike(stringValue);
-                    } else
-                        processDefinitionQuery.processDefinitionKey(stringValue);
-                    break;
-                case "category":
-                    if (term.getTermType().equals(TermType.like))
-                        processDefinitionQuery.processDefinitionCategoryLike(stringValue);
-                    else
-                        processDefinitionQuery.processDefinitionCategory(stringValue);
-                    break;
-                case "deploymentId":
-                    processDefinitionQuery.deploymentId(stringValue);
-                    break;
-            }
-        });
-        int total = (int) processDefinitionQuery.count();
-        param.rePaging(total);
-        List<ProcessDefinition> models = processDefinitionQuery.listPage(param.getPageIndex(), param.getPageSize() * (param.getPageIndex() + 1));
-        return ResponseMessage.ok(new PagerResult<>(total, models))
-                .exclude(ProcessDefinitionEntity.class,"identityLinks");
-    }
-
-    /**
-     * 部署流程资源
-     * 加载ZIP文件中的流程
-     */
-    @PostMapping(value="/deploy")
-    public Object deploy(@RequestParam(value = "file", required = true) MultipartFile file) {
-        JSONObject modelNode = new JSONObject();
-        modelNode.put("succ","false");
-        // 获取上传的文件名
-        String fileName = file.getOriginalFilename();
-
-        try {
-            // 得到输入流(字节流)对象
-            InputStream fileInputStream = file.getInputStream();
-
-            // 文件的扩展名
-            String extension = FilenameUtils.getExtension(fileName);
-
-            // zip或者bar类型的文件用ZipInputStream方式部署
-            DeploymentBuilder deployment = repositoryService.createDeployment();
-            if (extension.equals("zip") || extension.equals("bar")) {
-                ZipInputStream zip = new ZipInputStream(fileInputStream);
-                deployment.addZipInputStream(zip);
-            } else {
-                // 其他类型的文件直接部署
-                deployment.addInputStream(fileName, fileInputStream);
-            }
-            deployment.deploy();
-            modelNode.put("message","流程部署完成");
-        } catch (Exception e) {
-            modelNode.put("message","流程部署失败,获取文件流失败");
-        }
-
-        return modelNode;
-    }
-
-    /**
-     * 读取流程资源
-     *
-     * @param processDefinitionId 流程定义ID
-     * @param resourceName        资源名称
-     */
-    @GetMapping(value = "/read-resource/{processDefinitionId}/{resourceName}")
-    public void readResource(@PathVariable String processDefinitionId, @PathVariable String resourceName, HttpServletResponse response)
-            throws Exception {
-        ProcessDefinitionQuery pdq = repositoryService.createProcessDefinitionQuery();
-        ProcessDefinition pd = pdq.processDefinitionId(processDefinitionId).singleResult();
-
-        // 通过接口读取
-        InputStream resourceAsStream = repositoryService.getResourceAsStream(pd.getDeploymentId(), resourceName);
-
-        // 输出资源内容到相应对象
-        byte[] b = new byte[1024];
-        int len = -1;
-        while ((len = resourceAsStream.read(b, 0, 1024)) != -1) {
-            response.getOutputStream().write(b, 0, len);
-        }
-    }
-
-    /***
-     * 流程定义转换Model
-     * @param processDefinitionId
-     * @return
-     * @throws UnsupportedEncodingException
-     * @throws XMLStreamException
-     */
-    @PutMapping(value = "/convert-to-model/{processDefinitionId}")
-    public Object convertToModel(@PathVariable String processDefinitionId)
-            throws UnsupportedEncodingException, XMLStreamException {
-        JSONObject jsonObject = new JSONObject();
-        try {
-            ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
-                    .processDefinitionId(processDefinitionId).singleResult();
-            InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(),
-                    processDefinition.getResourceName());
-            XMLInputFactory xif = XMLInputFactory.newInstance();
-            InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8");
-            XMLStreamReader xtr = xif.createXMLStreamReader(in);
-            BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
-
-            BpmnJsonConverter converter = new BpmnJsonConverter();
-            com.fasterxml.jackson.databind.node.ObjectNode modelNode = converter.convertToJson(bpmnModel);
-            Model modelData = repositoryService.newModel();
-            modelData.setKey(processDefinition.getKey());
-            modelData.setName(processDefinition.getResourceName().substring(0, processDefinition.getResourceName().indexOf(".")));
-            modelData.setCategory(processDefinition.getDeploymentId());
-
-            ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
-            modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, processDefinition.getName());
-            modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1);
-            modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, processDefinition.getDescription());
-            modelData.setMetaInfo(modelObjectNode.toString());
-
-            repositoryService.saveModel(modelData);
-
-            repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8"));
-            jsonObject.put("succ",true);
-            jsonObject.put("message","转换完成");
-        }catch (Exception e){
-            jsonObject.put("succ",false);
-            jsonObject.put("message","转换失败");
-        }
-        return jsonObject;
-    }
-
-    /**
-     * 删除部署的流程,如果流程下有正在运行的流程实例则报错
-     *
-     * @param deploymentId 流程部署ID
-     */
-    @PutMapping(value = "/delete-deployment/{deploymentId}")
-    @ResponseStatus(value = HttpStatus.OK)
-    public Object deleteProcessDefinition(@PathVariable String deploymentId) {
-        JSONObject jsonObject = new JSONObject();
-        try{
-            repositoryService.deleteDeployment(deploymentId);
-            jsonObject.put("succ",true);
-        }catch (Exception e){
-            jsonObject.put("succ",false);
-        }
-        return jsonObject;
-    }
-
-    /**
-     * 删除部署的流程,级联删除流程实例
-     *
-     * @param deploymentId 流程部署ID
-     */
-    @PutMapping(value = "/delete-deploy/{deploymentId}")
-    @ResponseStatus(value = HttpStatus.OK)
-    public Object deleteProcess(@PathVariable String deploymentId) {
-        JSONObject jsonObject = new JSONObject();
-        try{
-            repositoryService.deleteDeployment(deploymentId,true);
-            jsonObject.put("succ",true);
-        }catch (Exception e){
-            jsonObject.put("succ",false);
-        }
-        return jsonObject;
-    }
-
-    /**
-     * 查看当前节点流程图
-     * @param processInstanceId
-     * @return  当前节点
-     * window.open('/showImage?processInstanceId=' + processInstanceId, 'newwindow', 'height=500, width=1000, top=100,left=200, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
-     *      <div>
-                <#if message??>
-                    <h1>${message!}</h1>
-                <#else>
-                    <img src="${application.getContextPath()}/workflow/document/alldoc/findPic/${procDefId!}">
-                    <!-- 给执行的节点加框 -->
-                    <div style="position:absolute; border:2px solid red;left:${activity.x+6 }px;
-                    top:${activity.y+6 }px;width:${activity.width }px;height:${activity.height }px;"></div>
-                </#if>
-            </div>
-     */
-    @GetMapping("/showImage/{processInstanceId}")
-    public Object showImage(@PathVariable String processInstanceId){
-        JSONObject jsonObject = new JSONObject();
-        HistoricProcessInstance processInstance = bpmTaskService.selectHisProInst(processInstanceId);
-        if(processInstance!=null){
-            ActivityImpl activity = bpmActivityService.getActivityByProcInstId(processInstance.getProcessDefinitionId(),processInstance.getId());
-            jsonObject.put("activity",activity);
-            jsonObject.put("procDefId",processInstance.getProcessDefinitionId());
-        }else{
-            jsonObject.put("message","获取流程图失败");
-            logger.debug("获取流程节点,processInstanceId:"+processInstanceId);
-        }
-        return jsonObject;
-    }
-
-    @GetMapping("/findPic/{procDefId}")
-    public void findPic(@PathVariable String procDefId,HttpServletResponse response){
-        try{
-            InputStream inputStream = bpmProcessService.findProcessPic(procDefId);
-            byte[] b = new byte[1024];
-            int len = 0;
-            while ((len = inputStream.read(b,0,1024))!=-1){
-                response.getOutputStream().write(b, 0, len);
-            }
-        }catch (Exception e){
-            logger.debug("获取流程图失败,procDefId:"+procDefId);
-        }
-    }
-}
+//package org.hswebframework.web.workflow.flowable.controller;
+//
+//import com.alibaba.fastjson.JSONObject;
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//import com.fasterxml.jackson.databind.node.ObjectNode;
+//import org.activiti.bpmn.converter.BpmnXMLConverter;
+//import org.activiti.bpmn.model.BpmnModel;
+//import org.activiti.editor.constants.ModelDataJsonConstants;
+//import org.activiti.editor.language.json.converter.BpmnJsonConverter;
+//import org.activiti.engine.history.HistoricProcessInstance;
+//import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
+//import org.activiti.engine.impl.pvm.process.ActivityImpl;
+//import org.activiti.engine.repository.DeploymentBuilder;
+//import org.activiti.engine.repository.Model;
+//import org.activiti.engine.repository.ProcessDefinition;
+//import org.activiti.engine.repository.ProcessDefinitionQuery;
+//import org.apache.commons.io.FilenameUtils;
+//import org.hsweb.ezorm.core.PropertyWrapper;
+//import org.hsweb.ezorm.core.SimplePropertyWrapper;
+//import org.hsweb.ezorm.core.param.TermType;
+//import org.hswebframework.web.commons.entity.PagerResult;
+//import org.hswebframework.web.commons.entity.param.QueryParamEntity;
+//import org.hswebframework.web.controller.message.ResponseMessage;
+//import org.hswebframework.web.workflow.flowable.service.BpmActivityService;
+//import org.hswebframework.web.workflow.flowable.service.BpmProcessService;
+//import org.hswebframework.web.workflow.flowable.service.BpmTaskService;
+//import org.hswebframework.web.workflow.flowable.utils.FlowableAbstract;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.http.HttpStatus;
+//import org.springframework.web.bind.annotation.*;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import javax.servlet.http.HttpServletResponse;
+//import javax.xml.stream.XMLInputFactory;
+//import javax.xml.stream.XMLStreamException;
+//import javax.xml.stream.XMLStreamReader;
+//import java.io.InputStream;
+//import java.io.InputStreamReader;
+//import java.io.UnsupportedEncodingException;
+//import java.util.List;
+//import java.util.zip.ZipInputStream;
+//
+///**
+// * @Author wangwei
+// * @Date 2017/7/31.
+// */
+//@RestController
+//@RequestMapping("/workflow/definition")
+//public class BpmDeploymentController extends FlowableAbstract {
+//
+//    protected Logger logger = LoggerFactory.getLogger(this.getClass());
+//
+//    @Autowired
+//    BpmTaskService bpmTaskService;
+//
+//    @Autowired
+//    BpmProcessService bpmProcessService;
+//    @Autowired
+//    BpmActivityService bpmActivityService;
+//
+//    /**
+//     * 流程定义列表
+//     */
+//    @GetMapping("/list")
+//    public ResponseMessage<PagerResult<ProcessDefinition>> processList(QueryParamEntity param) {
+//        ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
+//        param.getTerms().forEach((term) -> {
+//
+//            PropertyWrapper valueWrapper = new SimplePropertyWrapper(term.getValue());
+//            String stringValue = valueWrapper.toString();
+//            switch (term.getColumn()) {
+//                case "name":
+//                    if (term.getTermType().equals(TermType.like)) {
+//                        processDefinitionQuery.processDefinitionNameLike(stringValue);
+//                    } else
+//                        processDefinitionQuery.processDefinitionName(stringValue);
+//                    break;
+//                case "key":
+//                    if (term.getTermType().equals(TermType.like)) {
+//                        processDefinitionQuery.processDefinitionKeyLike(stringValue);
+//                    } else
+//                        processDefinitionQuery.processDefinitionKey(stringValue);
+//                    break;
+//                case "category":
+//                    if (term.getTermType().equals(TermType.like))
+//                        processDefinitionQuery.processDefinitionCategoryLike(stringValue);
+//                    else
+//                        processDefinitionQuery.processDefinitionCategory(stringValue);
+//                    break;
+//                case "deploymentId":
+//                    processDefinitionQuery.deploymentId(stringValue);
+//                    break;
+//            }
+//        });
+//        int total = (int) processDefinitionQuery.count();
+//        param.rePaging(total);
+//        List<ProcessDefinition> models = processDefinitionQuery.listPage(param.getPageIndex(), param.getPageSize() * (param.getPageIndex() + 1));
+//        return ResponseMessage.ok(new PagerResult<>(total, models))
+//                .exclude(ProcessDefinitionEntity.class,"identityLinks");
+//    }
+//
+//    /**
+//     * 部署流程资源
+//     * 加载ZIP文件中的流程
+//     */
+//    @PostMapping(value="/deploy")
+//    public Object deploy(@RequestParam(value = "file", required = true) MultipartFile file) {
+//        JSONObject modelNode = new JSONObject();
+//        modelNode.put("succ","false");
+//        // 获取上传的文件名
+//        String fileName = file.getOriginalFilename();
+//
+//        try {
+//            // 得到输入流(字节流)对象
+//            InputStream fileInputStream = file.getInputStream();
+//
+//            // 文件的扩展名
+//            String extension = FilenameUtils.getExtension(fileName);
+//
+//            // zip或者bar类型的文件用ZipInputStream方式部署
+//            DeploymentBuilder deployment = repositoryService.createDeployment();
+//            if (extension.equals("zip") || extension.equals("bar")) {
+//                ZipInputStream zip = new ZipInputStream(fileInputStream);
+//                deployment.addZipInputStream(zip);
+//            } else {
+//                // 其他类型的文件直接部署
+//                deployment.addInputStream(fileName, fileInputStream);
+//            }
+//            deployment.deploy();
+//            modelNode.put("message","流程部署完成");
+//        } catch (Exception e) {
+//            modelNode.put("message","流程部署失败,获取文件流失败");
+//        }
+//
+//        return modelNode;
+//    }
+//
+//    /**
+//     * 读取流程资源
+//     *
+//     * @param processDefinitionId 流程定义ID
+//     * @param resourceName        资源名称
+//     */
+//    @GetMapping(value = "/read-resource/{processDefinitionId}/{resourceName}")
+//    public void readResource(@PathVariable String processDefinitionId, @PathVariable String resourceName, HttpServletResponse response)
+//            throws Exception {
+//        ProcessDefinitionQuery pdq = repositoryService.createProcessDefinitionQuery();
+//        ProcessDefinition pd = pdq.processDefinitionId(processDefinitionId).singleResult();
+//
+//        // 通过接口读取
+//        InputStream resourceAsStream = repositoryService.getResourceAsStream(pd.getDeploymentId(), resourceName);
+//
+//        // 输出资源内容到相应对象
+//        byte[] b = new byte[1024];
+//        int len = -1;
+//        while ((len = resourceAsStream.read(b, 0, 1024)) != -1) {
+//            response.getOutputStream().write(b, 0, len);
+//        }
+//    }
+//
+//    /***
+//     * 流程定义转换Model
+//     * @param processDefinitionId
+//     * @return
+//     * @throws UnsupportedEncodingException
+//     * @throws XMLStreamException
+//     */
+//    @PutMapping(value = "/convert-to-model/{processDefinitionId}")
+//    public Object convertToModel(@PathVariable String processDefinitionId)
+//            throws UnsupportedEncodingException, XMLStreamException {
+//        JSONObject jsonObject = new JSONObject();
+//        try {
+//            ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+//                    .processDefinitionId(processDefinitionId).singleResult();
+//            InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(),
+//                    processDefinition.getResourceName());
+//            XMLInputFactory xif = XMLInputFactory.newInstance();
+//            InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8");
+//            XMLStreamReader xtr = xif.createXMLStreamReader(in);
+//            BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
+//
+//            BpmnJsonConverter converter = new BpmnJsonConverter();
+//            com.fasterxml.jackson.databind.node.ObjectNode modelNode = converter.convertToJson(bpmnModel);
+//            Model modelData = repositoryService.newModel();
+//            modelData.setKey(processDefinition.getKey());
+//            modelData.setName(processDefinition.getResourceName().substring(0, processDefinition.getResourceName().indexOf(".")));
+//            modelData.setCategory(processDefinition.getDeploymentId());
+//
+//            ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
+//            modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, processDefinition.getName());
+//            modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1);
+//            modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, processDefinition.getDescription());
+//            modelData.setMetaInfo(modelObjectNode.toString());
+//
+//            repositoryService.saveModel(modelData);
+//
+//            repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8"));
+//            jsonObject.put("succ",true);
+//            jsonObject.put("message","转换完成");
+//        }catch (Exception e){
+//            jsonObject.put("succ",false);
+//            jsonObject.put("message","转换失败");
+//        }
+//        return jsonObject;
+//    }
+//
+//    /**
+//     * 删除部署的流程,如果流程下有正在运行的流程实例则报错
+//     *
+//     * @param deploymentId 流程部署ID
+//     */
+//    @PutMapping(value = "/delete-deployment/{deploymentId}")
+//    @ResponseStatus(value = HttpStatus.OK)
+//    public Object deleteProcessDefinition(@PathVariable String deploymentId) {
+//        JSONObject jsonObject = new JSONObject();
+//        try{
+//            repositoryService.deleteDeployment(deploymentId);
+//            jsonObject.put("succ",true);
+//        }catch (Exception e){
+//            jsonObject.put("succ",false);
+//        }
+//        return jsonObject;
+//    }
+//
+//    /**
+//     * 删除部署的流程,级联删除流程实例
+//     *
+//     * @param deploymentId 流程部署ID
+//     */
+//    @PutMapping(value = "/delete-deploy/{deploymentId}")
+//    @ResponseStatus(value = HttpStatus.OK)
+//    public Object deleteProcess(@PathVariable String deploymentId) {
+//        JSONObject jsonObject = new JSONObject();
+//        try{
+//            repositoryService.deleteDeployment(deploymentId,true);
+//            jsonObject.put("succ",true);
+//        }catch (Exception e){
+//            jsonObject.put("succ",false);
+//        }
+//        return jsonObject;
+//    }
+//
+//    /**
+//     * 查看当前节点流程图
+//     * @param processInstanceId
+//     * @return  当前节点
+//     * window.open('/showImage?processInstanceId=' + processInstanceId, 'newwindow', 'height=500, width=1000, top=100,left=200, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
+//     *      <div>
+//                <#if message??>
+//                    <h1>${message!}</h1>
+//                <#else>
+//                    <img src="${application.getContextPath()}/workflow/document/alldoc/findPic/${procDefId!}">
+//                    <!-- 给执行的节点加框 -->
+//                    <div style="position:absolute; border:2px solid red;left:${activity.x+6 }px;
+//                    top:${activity.y+6 }px;width:${activity.width }px;height:${activity.height }px;"></div>
+//                </#if>
+//            </div>
+//     */
+//    @GetMapping("/showImage/{processInstanceId}")
+//    public Object showImage(@PathVariable String processInstanceId){
+//        JSONObject jsonObject = new JSONObject();
+//        HistoricProcessInstance processInstance = bpmTaskService.selectHisProInst(processInstanceId);
+//        if(processInstance!=null){
+//            ActivityImpl activity = bpmActivityService.getActivityByProcInstId(processInstance.getProcessDefinitionId(),processInstance.getId());
+//            jsonObject.put("activity",activity);
+//            jsonObject.put("procDefId",processInstance.getProcessDefinitionId());
+//        }else{
+//            jsonObject.put("message","获取流程图失败");
+//            logger.debug("获取流程节点,processInstanceId:"+processInstanceId);
+//        }
+//        return jsonObject;
+//    }
+//
+//    @GetMapping("/findPic/{procDefId}")
+//    public void findPic(@PathVariable String procDefId,HttpServletResponse response){
+//        try{
+//            InputStream inputStream = bpmProcessService.findProcessPic(procDefId);
+//            byte[] b = new byte[1024];
+//            int len = 0;
+//            while ((len = inputStream.read(b,0,1024))!=-1){
+//                response.getOutputStream().write(b, 0, len);
+//            }
+//        }catch (Exception e){
+//            logger.debug("获取流程图失败,procDefId:"+procDefId);
+//        }
+//    }
+//}

+ 23 - 4
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/service/BpmActivityService.java

@@ -3,6 +3,7 @@ package org.hswebframework.web.workflow.flowable.service;
 import org.activiti.engine.impl.pvm.process.ActivityImpl;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 流程节点操作的接口
@@ -13,17 +14,17 @@ public interface BpmActivityService {
     /**
      * 获取指定节点
      *
-     * @param procDefId        流程定义ID
-     * @return ActivityImpl       指定的节点资源
+             * @param procDefId        流程定义ID
+     * @return ActivityImpl       指定的节点资源,未指定返回第一节点
      */
     ActivityImpl getActivityById(String procDefId, String activityId);
 
     /**
-     * 获取指定节点
+     * 获取所有节点
      *
      * @param procDefKey        流程定义Key
      * @param activityId        图元ID
-     * @return ActivityImpl       指定的节点,未指定返回当前节点
+     * @return ActivityImpl       指定的节点,未指定返回所有
      */
     List<ActivityImpl> getActivityByKey(String procDefKey, String activityId);
 
@@ -52,6 +53,24 @@ public interface BpmActivityService {
      */
     List<ActivityImpl> getUserTasksByProcDefKey(String procDefKey);
 
+    /**
+     * 获取下一环节
+     *
+     * @param procDefId        流程定义ID
+     * @param activityId        图元ID
+     * @return List<ActivityImpl>  当前流程的所有节点资源
+     */
+    List<ActivityImpl> getNextActivitys(String procDefId, String activityId);
+
+    /**
+     * 获取下一环节办理人
+     *
+     * @param procDefId        流程定义ID
+     * @param activityId        图元ID
+     * @return   节点id对应的办理人
+     */
+    Map<String, List<String>> getNextClaim(String procDefId, String activityId);
+
     /**
      * 获取开始节点
      * @param procDefKey        流程定义Key

+ 38 - 6
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/service/imp/BpmActivityServiceImp.java

@@ -1,5 +1,6 @@
 package org.hswebframework.web.workflow.flowable.service.imp;
 
+import org.activiti.engine.delegate.Expression;
 import org.activiti.engine.impl.RepositoryServiceImpl;
 import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
 import org.activiti.engine.impl.pvm.PvmTransition;
@@ -11,10 +12,7 @@ import org.hswebframework.web.workflow.flowable.service.BpmActivityService;
 import org.hswebframework.web.workflow.flowable.utils.FlowableAbstract;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
+import java.util.*;
 
 /**
  * @Author wangwei
@@ -96,8 +94,42 @@ public class BpmActivityServiceImp extends FlowableAbstract implements BpmActivi
     }
 
     @Override
-    public ActivityImpl getStartEvent(String procDefKey) {
-        List<ActivityImpl> activities = getActivityByKey("test",null);
+    public List<ActivityImpl> getNextActivitys(String procDefId, String activityId) {
+        ActivityImpl activity;
+        if(activityId!=null)
+            activity = getActivityById(procDefId, activityId);
+        else
+            activity = getStartEvent(procDefId);
+        List<PvmTransition> pvmTransitions = activity.getOutgoingTransitions();
+        List<ActivityImpl> activities = new ArrayList<>();
+        for(PvmTransition pvmTransition : pvmTransitions){
+            activities.add((ActivityImpl)pvmTransition.getDestination());
+        }
+        return activities;
+    }
+
+    @Override
+    public Map<String, List<String>> getNextClaim(String procDefId, String activityId) {
+        List<ActivityImpl> activities = getNextActivitys(procDefId, activityId);
+        Map<String, List<String>> map = new HashMap<>();
+        for(ActivityImpl activity : activities){
+            List<String> list = new ArrayList<>();
+            TaskDefinition taskDefinition = (TaskDefinition) activity.getProperty("taskDefinition");
+            if(taskDefinition.getAssigneeExpression()!=null)
+                list.add(taskDefinition.getAssigneeExpression().getExpressionText());
+            else if(taskDefinition.getCandidateUserIdExpressions()!=null){
+                for(Expression expression : taskDefinition.getCandidateUserIdExpressions()){
+                    list.add(expression.getExpressionText());
+                }
+            }
+            map.put(activity.getId(),list);
+        }
+        return map;
+    }
+
+    @Override
+    public ActivityImpl getStartEvent(String procDefId) {
+        List<ActivityImpl> activities = getActivitysById(procDefId,null);
         ActivityImpl activity = null;
         for (ActivityImpl a: activities) {
             if(a.getProperty("type").equals("startEvent")){

+ 2 - 1
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/test/java/org/hswebframework/web/workflow/flowable/ControllerTest.java

@@ -62,7 +62,8 @@ public class ControllerTest extends SimpleWebApplicationTests {
                 System.out.println(a);
                 List<PvmTransition> pvmTransitions = a.getOutgoingTransitions();
                 Assert.assertEquals(pvmTransitions.size(), 1);
-                System.out.println("流程第一节点办理人:"+((TaskDefinition)pvmTransitions.get(0).getDestination().getProperty("taskDefinition")).getAssigneeExpression());
+                TaskDefinition taskDefinition = (TaskDefinition)pvmTransitions.get(0).getDestination().getProperty("taskDefinition");
+                System.out.println("流程第一节点办理人:"+taskDefinition.getAssigneeExpression());
             }
         }
     }