Business Objects
Business data of a process is modelled as Java classes (the process variables). Extend the ecceene base class so every object carries its type - user interfaces and reports can then recognise objects generically.
EccBo
package com.ecceene.bpm.demo.purchase;
import java.util.List;
import com.ecceene.bpm.EccBo;
import com.ecceene.bpm.EccDecisionBoolean;
import com.ecceene.bpm.EccPerson;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class BoPurchase extends EccBo {
private String title;
private EccPerson requester;
private String requesterCostCenter;
private String requestType;
private String reason;
private boolean personalData;
private List<BoPurchaseItem> items;
private EccDecisionBoolean managementApproval;
public BoPurchase() {
super(DATATYPE_DATA, "1.0"); // eccType, eccVersion
}
}
Objects in this example: EccBo, EccDecisionBoolean, EccPerson.
Every instance serializes with three extra fields:
{
"eccClassname": "BoPurchase",
"eccType": "data",
"eccVersion": "1.0",
"title": "Laptop for new team member",
"requester": { "name": "Anna Berger", "department": "IT", "email": "anna.berger@example.org", "phone": "+49 30 1234-56" }
}
|
| business data |
|
| process metadata |
|
| task data |
|
| decisions |
|
| persons |
Increase eccVersion when the structure changes incompatibly.
EccPerson
A person as part of business data (requester, contact, signer):
|
|
|
|
|
|
|
|
EccDecisionBoolean
The standard result of an approval task:
|
| the decision |
|
| reason |
|
| when |
|
| who |
|
| technical id of the decision point, e.g. |
|
| display name, e.g. "First level approval" |
Map it as data output of the approval task and use it in the gateway after the task:
// condition of the "approved" sequence flow
return decisionBoolean.isApproved();
The matching task page writes output.decisionBoolean.approved, .comment, .decisionDate, … - see Task Page.
Tips
- Use
java.util.Datefor dates; the UI sends ISO 8601 strings that map directly. - Keep business objects free of logic - they are serialized into the process history on every step.
- Large binary content (documents) does not belong into process variables;
byte[]values are excluded from the history.
On this page
- Business Objects