Tabnine Logo
Model.setKey
Code IndexAdd Tabnine to your IDE (free)

How to use
setKey
method
in
org.activiti.engine.repository.Model

Best Java code snippets using org.activiti.engine.repository.Model.setKey (Showing top 10 results out of 315)

origin: hs-web/hsweb-framework

@PostMapping
@ResponseStatus(value = HttpStatus.CREATED)
@ApiOperation("创建模型")
public ResponseMessage<Model> createModel(@RequestBody ModelCreateRequest model) throws Exception {
  JSONObject stencilset = new JSONObject();
  stencilset.put("namespace", "http://b3mn.org/stencilset/bpmn2.0#");
  JSONObject editorNode = new JSONObject();
  editorNode.put("id", "canvas");
  editorNode.put("resourceId", "canvas");
  editorNode.put("stencilset", stencilset);
  JSONObject modelObjectNode = new JSONObject();
  modelObjectNode.put(MODEL_REVISION, 1);
  modelObjectNode.put(MODEL_DESCRIPTION, model.getDescription());
  modelObjectNode.put(MODEL_KEY, model.getKey());
  modelObjectNode.put(MODEL_NAME, model.getName());
  Model modelData = repositoryService.newModel();
  modelData.setMetaInfo(modelObjectNode.toJSONString());
  modelData.setName(model.getName());
  modelData.setKey(model.getKey());
  repositoryService.saveModel(modelData);
  repositoryService.addModelEditorSource(modelData.getId(), editorNode.toString().getBytes("utf-8"));
  return ResponseMessage.ok(modelData).status(201);
}
origin: hs-web/hsweb-framework

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());
origin: bill1012/AdminEAP

model.setKey(key);
model.setMetaInfo(modelNode.toString());
origin: bluejoe2008/openwebflow

  public static void importModel(RepositoryService repositoryService, File modelFile) throws IOException,
      XMLStreamException
  {
    InputStreamReader reader = new InputStreamReader(new FileInputStream(modelFile), "utf-8");
    String fileContent = IOUtils.readStringAndClose(reader, (int) modelFile.length());

    BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(new StringStreamSourceEx(fileContent), false,
      false);

    String processName = bpmnModel.getMainProcess().getName();
    if (processName == null || processName.isEmpty())
    {
      processName = bpmnModel.getMainProcess().getId();
    }

    Model modelData = repositoryService.newModel();
    ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
    modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, processName);
    modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1);
    modelData.setMetaInfo(modelObjectNode.toString());
    modelData.setName(processName);
    modelData.setKey(modelFile.getName());

    repositoryService.saveModel(modelData);

    repositoryService.addModelEditorSource(modelData.getId(), fileContent.getBytes("utf-8"));
    Logger.getLogger(ModelUtils.class)
        .info(String.format("importing model file: %s", modelFile.getCanonicalPath()));
  }
}
origin: zhijund/jund-workflow

public static void addModel(Model copyModel, String key, String modelName, ObjectNode metaInfo, String tenantId) {
  copyModel.setKey(key);
  updateModel(copyModel, modelName, metaInfo, tenantId);
}
origin: org.hswebframework.web/hsweb-system-workflow-local

@PostMapping
@ResponseStatus(value = HttpStatus.CREATED)
@ApiOperation("创建模型")
public ResponseMessage<Model> createModel(@RequestBody ModelCreateRequest model) throws Exception {
  JSONObject stencilset = new JSONObject();
  stencilset.put("namespace", "http://b3mn.org/stencilset/bpmn2.0#");
  JSONObject editorNode = new JSONObject();
  editorNode.put("id", "canvas");
  editorNode.put("resourceId", "canvas");
  editorNode.put("stencilset", stencilset);
  JSONObject modelObjectNode = new JSONObject();
  modelObjectNode.put(MODEL_REVISION, 1);
  modelObjectNode.put(MODEL_DESCRIPTION, model.getDescription());
  modelObjectNode.put(MODEL_KEY, model.getKey());
  modelObjectNode.put(MODEL_NAME, model.getName());
  Model modelData = repositoryService.newModel();
  modelData.setMetaInfo(modelObjectNode.toJSONString());
  modelData.setName(model.getName());
  modelData.setKey(model.getKey());
  repositoryService.saveModel(modelData);
  repositoryService.addModelEditorSource(modelData.getId(), editorNode.toString().getBytes("utf-8"));
  return ResponseMessage.ok(modelData).status(201);
}
origin: com.github.tianjing/tgtools.activiti.modeler

model.setKey(key);
model.setMetaInfo(modelNode.toString());
origin: org.activiti/activiti-rest

 @ApiOperation(value = "Create a model", tags = {"Models"}, notes = "All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only setting the name of the model, leaving all other fields null.")
 @ApiResponses(value = {
   @ApiResponse(code = 200, message = "Indicates the model was created.")
 })
 @RequestMapping(value = "/repository/models", method = RequestMethod.POST, produces = "application/json")
 public ModelResponse createModel(@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response) {
  Model model = repositoryService.newModel();
  model.setCategory(modelRequest.getCategory());
  model.setDeploymentId(modelRequest.getDeploymentId());
  model.setKey(modelRequest.getKey());
  model.setMetaInfo(modelRequest.getMetaInfo());
  model.setName(modelRequest.getName());
  model.setVersion(modelRequest.getVersion());
  model.setTenantId(modelRequest.getTenantId());

  repositoryService.saveModel(model);
  response.setStatus(HttpStatus.CREATED.value());
  return restResponseFactory.createModelResponse(model);
 }
}
origin: org.hswebframework.web/hsweb-system-workflow-local

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());
origin: org.activiti/activiti-rest

model.setKey(modelRequest.getKey());
org.activiti.engine.repositoryModelsetKey

Popular methods of Model

  • setMetaInfo
  • setName
  • getId
  • getName
  • getMetaInfo
  • getCategory
  • setDeploymentId
  • getKey
  • setCategory
  • getTenantId
  • getVersion
  • setTenantId
  • getVersion,
  • setTenantId,
  • setVersion,
  • getCreateTime,
  • getDeploymentId,
  • getLastUpdateTime,
  • hasEditorSource,
  • hasEditorSourceExtra

Popular in Java

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JLabel (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now