예제 #1
0
 protected SyntaxChecker getCheckerBPMN11(Document document) {
   BPMN11RDFImporter importer = new BPMN11RDFImporter(document);
   BPMNDiagram diagram = importer.loadBPMN();
   if (context != null && context.equals("bpmn2pn")) {
     return new BPMN2PNSyntaxChecker(diagram);
   } else {
     return diagram.getSyntaxChecker();
   }
 }
예제 #2
0
  protected void processIBPMN(Document document, List<Transition> conflictingTransitions)
      throws SyntaxErrorException {
    IBPMNRDFImporter importer = new IBPMNRDFImporter(document);
    BPMNDiagram diagram = (IBPMNDiagram) importer.loadIBPMN();
    BPMNSyntaxChecker checker = diagram.getSyntaxChecker();
    if (!checker.checkSyntax()) throw new SyntaxErrorException(checker.getErrors());

    InteractionNet net = (InteractionNet) new IBPMNConverter(diagram).convert();

    new EnforceabilityChecker(net).checkEnforceability();
  }
예제 #3
0
  /**
   * Starts the transformation BPMN to BPEL according to the options parameter. It also writes the
   * HTTP-response
   *
   * @param document The diagram from the Oryx-Editor in RDF-format.
   * @param options The configuration of the transformation e.g. deployment or only transformation.
   * @param writer The writer of the response.
   */
  protected void processDocument(Document document, JSONObject options, PrintWriter writer) {
    response = new JSONObject();

    String type = new StencilSetUtil().getStencilSet(document);
    BPMNDiagram diagram = null;
    if (type.equals("bpmn.json")) diagram = new BPMNRDFImporter(document).loadBPMN();
    else if (type.equals("bpmn1.1.json")) diagram = new BPMN11RDFImporter(document).loadBPMN();

    /* Normalize diagram */
    if (diagram.getId() == null) diagram.setId(OryxUUID.generate());
    BPMNSESENormalizer normalizer = new BPMNSESENormalizer(diagram);
    normalizer.normalize();

    List<TransformationResult> results = null;
    try {
      BPMN2BPELTransformer transformer = new BPMN2BPELTransformer();

      /* Transform to BPEL */
      if (options.getString("action").equals("transform")) {
        results = transformer.transform(diagram);
      }

      /* Deployment on Apache ODE */
      else if (options.getString("action").equals("deploy")) {
        results =
            transformer.transformAndDeployProcessOnOde(diagram, options.getString("apacheOdeUrl"));
      }

      for (TransformationResult result : results) {
        if (result.getType().equals(TransformationResult.Type.PROCESS)) {
          appendResult("process", result.getDocument());
        }
        if (result.getType().equals(TransformationResult.Type.SERVICE_NAME)) {
          response.put(
              "serviceName",
              options.getString("apacheOdeUrl")
                  + "/processes/"
                  + (String) result.getObject()
                  + "?wsdl");
        }
        //			if(result.getType().equals(TransformationResult.Type.DEPLOYMENT_DESCRIPTOR)) {
        //				appendResult("deploy", result.getDocument());
        //			}
      }
    } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    writer.write(response.toString());
  }
예제 #4
0
 protected SyntaxChecker getCheckerIBPMN(Document document) {
   IBPMNRDFImporter importer = new IBPMNRDFImporter(document);
   BPMNDiagram diagram = (IBPMNDiagram) importer.loadIBPMN();
   return diagram.getSyntaxChecker();
 }
예제 #5
0
 protected SyntaxChecker getCheckerBPMN(Document document) {
   BPMNRDFImporter importer = new BPMNRDFImporter(document);
   BPMNDiagram diagram = importer.loadBPMN();
   return diagram.getSyntaxChecker();
 }