Ejemplo n.º 1
0
 /**
  * Get the transient properties.
  *
  * @return the transient properties.
  */
 @JsonIgnore
 @XmlTransient
 @Override
 public Map<String, Object> getTransientProperties() {
   return Collections.unmodifiableMap(transientProperties);
 }
Ejemplo n.º 2
0
 public Builder variable(String key, List<Value> values) {
   if (values != null) this.data.put(key, values);
   else this.data.put(key, Collections.<Value>emptyList());
   return this;
 }
Ejemplo n.º 3
0
 public Builder validation(String key, List<Message> messages) {
   if (messages != null) this.validation.put(key, messages);
   else this.validation.put(key, Collections.<Message>emptyList());
   return this;
 }
Ejemplo n.º 4
0
  private Form(Form.Builder builder, ViewContext context) {
    this.process = builder.process;
    this.formInstanceId = builder.formInstanceId;
    this.processInstanceId = builder.processInstanceId;
    this.submissionType = builder.submissionType;
    this.actionType = builder.actionType;
    this.layout = builder.layout;
    this.task = builder.task;
    this.container = builder.container;
    this.applicationStatusExplanation = builder.applicationStatusExplanation;
    this.explanation = builder.explanation;
    this.data = builder.data;
    this.validation = builder.validation;
    this.root =
        context != null
            ? context.getApplicationOrPublicUri(builder.anonymous, Constants.ROOT_ELEMENT_NAME)
            : null;
    this.action =
        context != null
            ? context.getApplicationOrPublicUri(
                builder.anonymous,
                Constants.ROOT_ELEMENT_NAME,
                builder.processDefinitionKey,
                builder.formInstanceId)
            : null;
    if (task != null && task.getTaskInstanceId() != null)
      this.link =
          context != null
              ? context.getApplicationOrPublicUri(
                      builder.anonymous, Constants.ROOT_ELEMENT_NAME, builder.processDefinitionKey)
                  + "?taskId="
                  + task.getTaskInstanceId()
              : null;
    else
      this.link =
          context != null
              ? context.getApplicationOrPublicUri(
                  builder.anonymous, Constants.ROOT_ELEMENT_NAME, builder.processDefinitionKey)
              : null;
    this.src =
        context != null
            ? context.getApplicationOrPublicUri(
                builder.anonymous, "resource", builder.processDefinitionKey, builder.formInstanceId)
            : null;
    this.staticRoot =
        context != null
            ? context.getApplicationOrPublicUri(
                builder.anonymous, "resource", "static", builder.processDefinitionKey)
            : null;
    this.assignment = builder.assignment;
    this.activation = builder.activation;
    this.attachment = builder.attachment;
    this.cancellation = builder.cancellation;

    this.history = builder.history;
    this.restart = builder.restart;
    this.suspension = builder.suspension;
    this.attachmentCount = builder.attachmentCount;
    this.attachments =
        builder.attachments != null
            ? Collections.unmodifiableList(builder.attachments)
            : Collections.<Attachment>emptyList();
    this.valid = builder.valid;
    this.external = builder.external;
    this.allowAttachments = builder.allowAttachments;
    this.anonymous = builder.anonymous;
    this.disposition = builder.disposition;
    this.currentUser = builder.currentUser;
    this.bucketUrl = builder.bucketUrl;
    this.bucketList = builder.bucketList;
  }