Package com.asakusafw.compiler.flow.jobflow

Examples of com.asakusafw.compiler.flow.jobflow.JobflowModel$Process


                  props.put("executable", ((Process) rootElement).isIsExecutable() + "");
                  props.put("id", rootElement.getId());
                    if( rootElement.getDocumentation() != null && rootElement.getDocumentation().size() > 0 ) {
                        props.put("documentation", rootElement.getDocumentation().get(0).getText());
                    }
                    Process pr = (Process) rootElement;
                    if(pr.getName() != null && pr.getName().length() > 0) {
                        props.put("processn", unescapeXML(((Process) rootElement).getName()));
                    }

                  List<Property> processProperties = ((Process) rootElement).getProperties();
                  if(processProperties != null && processProperties.size() > 0) {
View Full Code Here


          generator.writeStartObject();
          generator.writeObjectField("resourceId", outgoing.getId());
          generator.writeEndObject();
        }
        // we need to also add associations as outgoing elements
        Process process = (Process) plane.getBpmnElement();
        for (Artifact artifact : process.getArtifacts()) {
          if (artifact instanceof Association){
                Association association = (Association) artifact;
                if (association.getSourceRef().getId().equals(node.getId())) {
                  generator.writeStartObject();
                  generator.writeObjectField("resourceId", association.getId());
                  generator.writeEndObject();
                }
          }
        }
        // and boundary events for activities
        for(FlowElement fe : process.getFlowElements()) {
          if(fe instanceof BoundaryEvent) {
            if(((BoundaryEvent) fe).getAttachedToRef().getId().equals(node.getId())) {
              generator.writeStartObject();
                    generator.writeObjectField("resourceId", fe.getId());
                    generator.writeEndObject();
View Full Code Here

    }

        Association outgoingAssociaton = findOutgoingAssociation(plane, dataObject);
        Association incomingAssociation = null;

        Process process = (Process) plane.getBpmnElement();
        for (Artifact artifact : process.getArtifacts()) {
            if (artifact instanceof Association){
                Association association = (Association) artifact;
                if (association.getTargetRef() == dataObject){
                    incomingAssociation = association;
                }
View Full Code Here

          generator.writeStartObject();
          generator.writeObjectField("resourceId", outgoing.getId());
          generator.writeEndObject();
        }
      // subprocess boundary events
      Process process = (Process) plane.getBpmnElement();
        for(FlowElement fe : process.getFlowElements()) {
          if(fe instanceof BoundaryEvent) {
            if(((BoundaryEvent) fe).getAttachedToRef().getId().equals(subProcess.getId())) {
              generator.writeStartObject();
                    generator.writeObjectField("resourceId", fe.getId());
                    generator.writeEndObject();
View Full Code Here

      }
        if (!(plane.getBpmnElement() instanceof Process)){
            throw new IllegalArgumentException("Don't know how to get associations from a non-Process Diagram");
        }
       
        Process process = (Process) plane.getBpmnElement();
        for (Artifact artifact : process.getArtifacts()) {
            if (artifact instanceof Association){
                Association association = (Association) artifact;
                if (association.getSourceRef() == baseElement){
                    _diagramAssociations.put(baseElement.getId(), association);
                    return association;
View Full Code Here

        List<Association> retList = new ArrayList<Association>();
        if (!(plane.getBpmnElement() instanceof Process)){
            throw new IllegalArgumentException("Don't know how to get associations from a non-Process Diagram");
        }

        Process process = (Process) plane.getBpmnElement();
        for (Artifact artifact : process.getArtifacts()) {
            if (artifact instanceof Association){
                Association association = (Association) artifact;
                if (association.getSourceRef() == baseElement){
                    retList.add(association);
                }
View Full Code Here

            List<RootElement> rootElements =  def.getRootElements();
            Scenario defaultScenario = getDefaultScenario(def);

            for(RootElement root : rootElements) {
                if(root instanceof Process) {
                    Process process = (Process) root;
                    if(process.getFlowElements() != null && process.getFlowElements().size() > 0) {
                        defaultResourceId = process.getFlowElements().get(0).getId();
                    }

                    if(isEmpty(process.getId())) {
                        addError(defaultResourceId, new ValidationSyntaxError(process, BPMN2_TYPE, "Process has no id."));
                    } else {
                        if(!SyntaxCheckerUtils.isNCName(process.getId())) {
                            addError(defaultResourceId, new ValidationSyntaxError(process, BPMN2_TYPE,  "Invalid process id. See http://www.w3.org/TR/REC-xml-names/#NT-NCName for more info."));
                        }
                    }

                    String pname;
                    Iterator<FeatureMap.Entry> iter = process.getAnyAttribute().iterator();
                    boolean foundPackageName = false;
                    while(iter.hasNext()) {
                        FeatureMap.Entry entry = iter.next();
                        if(entry.getEStructuralFeature().getName().equals("packageName")) {
                            foundPackageName = true;
                            pname = (String) entry.getValue();
                            if(isEmpty(pname)) {
                                addError(defaultResourceId, new ValidationSyntaxError(process, BPMN2_TYPE,  "Process has no package name."));
                            }
                            if(!isValidPackageName(pname)) {
                                addError(defaultResourceId, new ValidationSyntaxError(process, BPMN2_TYPE,  "Package name contains invalid characters."));
                            }
                        }
                    }
                    if(!foundPackageName) {
                        addError(defaultResourceId, new ValidationSyntaxError(process, BPMN2_TYPE,  "Process has no package name."));
                    }

                    if(isEmpty(process.getName())) {
                        addError(defaultResourceId, new ValidationSyntaxError(process, BPMN2_TYPE,  "Process has no name."));
                    }

                    List<Property> processProperties = process.getProperties();
                    if(processProperties != null && processProperties.size() > 0) {
                        for(Property prop : processProperties) {
                            String propId = prop.getId();
                            Pattern pattern = Pattern.compile("\\s");
                            Matcher matcher = pattern.matcher(propId);
                            if(matcher.find()) {
                                addError(defaultResourceId, new ValidationSyntaxError(process, BPMN2_TYPE,  "Process variable \"" + propId + "\" contains white spaces."));
                            }
                        }
                    }

                    boolean foundStartEvent = false;
                    boolean foundEndEvent = false;
                    List<FlowElement> flowElements =  process.getFlowElements();
                    for(FlowElement fe : flowElements) {
                        if(fe instanceof StartEvent) {
                            foundStartEvent = true;
                        }
                        if(fe instanceof EndEvent) {
View Full Code Here

  @Override
  public void traverse(List<? extends EObject> contents) {
    for(EObject e : contents) {
      if(e instanceof Definitions) {
        List<RootElement> roots = ((Definitions) e).getRootElements();
        Process p = null;
        for(RootElement root : roots) {
          if(root instanceof Process) {
            p = (Process) root;
          }
        }
View Full Code Here

   
    public void processTemplates() {
        List<RootElement> rootElements = def.getRootElements();
        for(RootElement re : rootElements) {
            if(re instanceof Process) {
                Process process = (Process) re;
                if(process != null && process.getId() != null && process.getId().length() > 0) {

                    // get the list of process properties
                    List<Property> processProperties = process.getProperties();

                    if (taskId == null) {
                        TaskFormInfo tfi = new TaskFormInfo();
                        tfi.setId(process.getId() + "-taskform");
                        if(process.getName() != null && process.getName().length() > 0 ) {
                            tfi.setProcessName(process.getName());
                        } else {
                            tfi.setProcessName(process.getId());
                        }
                        tfi.setProcessId(process.getId());
                        //String packageName1 = "";
    //                    FeatureMap attrs = process.getAnyAttribute();
    //                    for (Object attr : attrs) {
    //                        EStructuralFeatureImpl.SimpleFeatureMapEntry a = (EStructuralFeatureImpl.SimpleFeatureMapEntry) attr;
    //                        if("packageName".equals(a.getEStructuralFeature().getName())) {
    //                            packageName1 = (String)a.getValue();
    //                        }
    //                    }
                        tfi.setPkgName(packageName);
                        for(Property prop : processProperties) {
                            if(isValidStructureRef(prop.getItemSubjectRef().getStructureRef())) {
                                TaskFormInput input = new TaskFormInput();
                                input.setName(prop.getId());
                                input.setRefType(prop.getItemSubjectRef().getStructureRef());
                                tfi.getTaskInputs().add(input);
                            }
                        }
                        tfi.setProcessForm(true);
                        tfi.setUserTaskForm(false);
                        taskFormInformationList.add(tfi);
                    }
                   
                    for(FlowElement fe : process.getFlowElements()) {
                        if(fe instanceof UserTask) {
                            getTaskInfoForUserTask((UserTask) fe, process, processProperties, taskId);
                        } else if(fe instanceof FlowElementsContainer) {
                            getTaskInfoForContainers((FlowElementsContainer) fe, process, processProperties, taskId);
                        }
View Full Code Here

      FixFlowConverter fixFlowConverter = new FixFlowConverter();
     
        ObjectMapper objectMapper = new ObjectMapper();
            InputStream input = new FileInputStream(buildPath() +File.separator+request.getParameter("fileName"));
            Definitions definitions = fixFlowConverter.getDefinitions("process_1", input);
            Process process = (Process)definitions.getRootElements().get(0);
        ObjectNode on = fixFlowConverter.convertDefinitions2Json(definitions);
        ObjectNode rootNode = objectMapper.createObjectNode();
        rootNode.put("name", process.getName());
        rootNode.put("description", process.getName());
        rootNode.put("modelId", process.getId());
        rootNode.put("model", on);
        out = response.getWriter();
        out.print(rootNode);
    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.flow.jobflow.JobflowModel$Process

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.