Skip to content

Commit

Permalink
Merge pull request #327 from scireum/tba/process-id
Browse files Browse the repository at this point in the history
Allows to fetch the process id from a process context
  • Loading branch information
andyHa authored Apr 12, 2019
2 parents f6681e9 + 07c7d80 commit 61a69c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/sirius/biz/process/ProcessContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
*/
public interface ProcessContext extends TaskContextAdapter {

/**
* Returns the id of the process context.
*
* @return the id of the process
*/
String getProcessId();

/**
* Returns the title of the underlying process.
*
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/sirius/biz/process/ProcessEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ private void loadPreviousTimings() {
});
}

@Override
public String getProcessId() {
return processId;
}

@Override
public String getTitle() {
return processes.fetchProcess(processId).map(Process::getTitle).orElse(null);
Expand Down

0 comments on commit 61a69c9

Please sign in to comment.