-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Archived BPM failure): add REST controller (#3259)
Covers [BPM-328](https://bonitasoft.atlassian.net/browse/BPM-328) --------- Co-authored-by: bonita-ci <hudson.mailer@bonitasoft.com>
- Loading branch information
1 parent
98eb64c
commit 2e439b1
Showing
5 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
bpm/bonita-common/src/main/java/org/bonitasoft/engine/bpm/ArchivedRestElement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Copyright (C) 2024 Bonitasoft S.A. | ||
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble | ||
* This library is free software; you can redistribute it and/or modify it under the terms | ||
* of the GNU Lesser General Public License as published by the Free Software Foundation | ||
* version 2.1 of the License. | ||
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Lesser General Public License for more details. | ||
* You should have received a copy of the GNU Lesser General Public License along with this | ||
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth | ||
* Floor, Boston, MA 02110-1301, USA. | ||
**/ | ||
package org.bonitasoft.engine.bpm; | ||
|
||
import java.util.Date; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonView; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
|
||
/** | ||
* Interface <code>ArchivedRestElement</code> identifies an archived <code>BonitaObject</code> that can be used in the | ||
* REST API. | ||
*/ | ||
public interface ArchivedRestElement extends ArchivedElement { | ||
|
||
/** | ||
* Gets the unique object identifier. | ||
* Serialized as a String in json as a Java long can be too big for JavaScript | ||
* | ||
* @return the unique object identifier | ||
*/ | ||
@JsonSerialize(using = ToStringSerializer.class) | ||
@Override | ||
long getSourceObjectId(); | ||
|
||
/** | ||
* Gets the date when the element was archived in milliseconds since epoch. | ||
* Serialized as a String in json as a Java long can be too big for JavaScript | ||
* | ||
* @return the unique object identifier | ||
*/ | ||
@JsonView | ||
@JsonProperty("archiveDate") | ||
@JsonSerialize(using = ToStringSerializer.class) | ||
long getArchiveDateAsLong(); | ||
|
||
/** | ||
* Gets the date when the element was archived. | ||
* Ignored in Json serialization as it is already serialized as a long | ||
* | ||
* @return the archived date | ||
*/ | ||
@JsonIgnore | ||
@Override | ||
Date getArchiveDate(); | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
bpm/bonita-common/src/main/java/org/bonitasoft/engine/bpm/BaseRestElement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright (C) 2024 Bonitasoft S.A. | ||
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble | ||
* This library is free software; you can redistribute it and/or modify it under the terms | ||
* of the GNU Lesser General Public License as published by the Free Software Foundation | ||
* version 2.1 of the License. | ||
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Lesser General Public License for more details. | ||
* You should have received a copy of the GNU Lesser General Public License along with this | ||
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth | ||
* Floor, Boston, MA 02110-1301, USA. | ||
**/ | ||
package org.bonitasoft.engine.bpm; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
|
||
/** | ||
* Interface <code>BaseRestElement</code> identifies a <code>BonitaObject</code> that can be used in the REST API. | ||
*/ | ||
public interface BaseRestElement extends BaseElement { | ||
|
||
/** | ||
* Gets the unique object identifier. | ||
* Serialized as a String in json as a Java long can be too big for JavaScript | ||
* | ||
* @return the unique object identifier | ||
*/ | ||
@JsonSerialize(using = ToStringSerializer.class) | ||
@Override | ||
long getId(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters