generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DTSSTCI-946 Add Publish to Camunda Flag for System Events (#1887)
* [DTSSTCI-946] Update hyperlink for next steps of completeHearingOutcome task * [DTSSTCI-946] Add publishToCamunda flags for system events to create tasks
- Loading branch information
Showing
4 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
14 changes: 13 additions & 1 deletion
14
...ain/java/uk/gov/hmcts/sptribs/systemupdate/event/SystemTriggerCompleteHearingOutcome.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 |
---|---|---|
@@ -1,28 +1,40 @@ | ||
package uk.gov.hmcts.sptribs.systemupdate.event; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
import uk.gov.hmcts.ccd.sdk.api.CCDConfig; | ||
import uk.gov.hmcts.ccd.sdk.api.ConfigBuilder; | ||
import uk.gov.hmcts.ccd.sdk.api.Event; | ||
import uk.gov.hmcts.sptribs.ciccase.model.CaseData; | ||
import uk.gov.hmcts.sptribs.ciccase.model.State; | ||
import uk.gov.hmcts.sptribs.ciccase.model.UserRole; | ||
|
||
import static uk.gov.hmcts.sptribs.ciccase.model.State.AwaitingHearing; | ||
import static uk.gov.hmcts.sptribs.ciccase.model.UserRole.ST_CIC_WA_CONFIG_USER; | ||
import static uk.gov.hmcts.sptribs.ciccase.model.UserRole.SYSTEM_UPDATE; | ||
import static uk.gov.hmcts.sptribs.ciccase.model.access.Permissions.CREATE_READ_UPDATE; | ||
import static uk.gov.hmcts.sptribs.ciccase.model.access.Permissions.CREATE_READ_UPDATE_DELETE; | ||
|
||
@Component | ||
public class SystemTriggerCompleteHearingOutcome implements CCDConfig<CaseData, State, UserRole> { | ||
|
||
public static final String SYSTEM_TRIGGER_COMPLETE_HEARING_OUTCOME = "system-trigger-complete-hearing-outcome"; | ||
|
||
@Value("${feature.wa.enabled}") | ||
private boolean isWorkAllocationEnabled; | ||
|
||
@Override | ||
public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) { | ||
configBuilder | ||
Event.EventBuilder<CaseData, UserRole, State> eventBuilder = configBuilder | ||
.event(SYSTEM_TRIGGER_COMPLETE_HEARING_OUTCOME) | ||
.forState(AwaitingHearing) | ||
.name("Trigger hearing outcome") | ||
.description("Trigger hearing outcome") | ||
.grant(CREATE_READ_UPDATE_DELETE, SYSTEM_UPDATE); | ||
|
||
if (isWorkAllocationEnabled) { | ||
eventBuilder.publishToCamunda() | ||
.grant(CREATE_READ_UPDATE, ST_CIC_WA_CONFIG_USER); | ||
} | ||
} | ||
} |
14 changes: 13 additions & 1 deletion
14
...java/uk/gov/hmcts/sptribs/systemupdate/event/SystemTriggerStitchCollateHearingBundle.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
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