Esempio n. 1
0
 public Builder taskSubresources(String processDefinitionKey, Task task, ViewContext context) {
   this.assignment =
       context != null && task != null && task.getTaskInstanceId() != null
           ? context.getApplicationUri(
               Task.Constants.ROOT_ELEMENT_NAME,
               processDefinitionKey,
               task.getTaskInstanceId(),
               "assign")
           : null;
   this.task = task;
   return this;
 }
Esempio n. 2
0
 public Builder instanceSubresources(
     String processDefinitionKey,
     String processInstanceId,
     Set<Attachment> attachments,
     int attachmentCount,
     ViewContext context) {
   this.processInstanceId = processInstanceId;
   this.activation =
       context.getApplicationUri(
           ProcessInstance.Constants.ROOT_ELEMENT_NAME,
           processDefinitionKey,
           processInstanceId,
           "activation");
   this.attachment =
       context.getApplicationUri(
           ProcessInstance.Constants.ROOT_ELEMENT_NAME,
           processDefinitionKey,
           processInstanceId,
           Attachment.Constants.ROOT_ELEMENT_NAME);
   this.cancellation =
       context.getApplicationUri(
           ProcessInstance.Constants.ROOT_ELEMENT_NAME,
           processDefinitionKey,
           processInstanceId,
           "cancellation");
   this.history =
       context.getApplicationUri(
           ProcessInstance.Constants.ROOT_ELEMENT_NAME,
           processDefinitionKey,
           processInstanceId,
           History.Constants.ROOT_ELEMENT_NAME);
   this.restart =
       context.getApplicationUri(
           ProcessInstance.Constants.ROOT_ELEMENT_NAME,
           processDefinitionKey,
           processInstanceId,
           "restart");
   this.suspension =
       context.getApplicationUri(
           ProcessInstance.Constants.ROOT_ELEMENT_NAME,
           processDefinitionKey,
           processInstanceId,
           "suspension");
   this.bucketUrl =
       context.getApplicationUri(
           ProcessInstance.Constants.ROOT_ELEMENT_NAME,
           processDefinitionKey,
           processInstanceId,
           "value/Bucket");
   if (attachments != null && !attachments.isEmpty()) {
     PassthroughSanitizer passthroughSanitizer = new PassthroughSanitizer();
     this.attachmentCount = attachments.size();
     this.attachments = new ArrayList<Attachment>(attachments.size());
     for (Attachment attachment : attachments) {
       this.attachments.add(
           new Attachment.Builder(attachment, passthroughSanitizer)
               .processDefinitionKey(processDefinitionKey)
               .processInstanceId(processInstanceId)
               .build(context));
     }
   } else {
     this.attachmentCount = attachmentCount;
   }
   return this;
 }