Source:
<code>private IAtsTeamWorkflow createSafetyAction(TransactionReadable tx, WordUpdateChange updateChange, IAtsTeamWorkflow teamWf, ArtifactReadable userArt) { IAtsTeamWorkflow teamWorkflow = null; try { IAtsActionableItem ai = atsServer.getConfig().getSoleByUuid(AtsArtifactToken.SafetyActionableItem.getUuid(), <START> IAtsActionableItem.class); <END> IAtsTeamDefinition teamDef = atsServer.getConfig().getSoleByUuid(AtsArtifactToken.SafetyTeamDefinition.getUuid(), IAtsTeamDefinition.class); IAtsUser createdBy = AtsCoreUsers.SYSTEM_USER; IAtsChangeSet changes = atsServer.getStoreService().createAtsChangeSet("Create System Safety Workflow", atsServer.getUserService().getUserById(userArt.getSoleAttributeAsString(CoreAttributeTypes.UserId))); teamWorkflow = atsServer.getActionFactory().createTeamWorkflow(atsServer.getActionFactory().getAction(teamWf), teamDef, java.util.Collections.singleton(ai), null, changes, new Date(), createdBy, new NewActionAdapter() { @Override public void teamCreated(IAtsAction action, IAtsTeamWorkflow teamWf, IAtsChangeSet changes) throws OseeCoreException { changes.setSoleAttributeValue(teamWf, AtsAttributeTypes.Description, "Review System Safety Changes for the associated RPCR to Complete the Workflow"); } }); changes.setSoleAttributeValue(teamWorkflow, CoreAttributeTypes.Name, "Safety Workflow for " + teamWf.getAtsId()); changes.execute(); } catch (Exception ex) { } return teamWorkflow; }</code><technical_language>Check for null give "Safety configured" exception</technical_language>

Target:
private IAtsTeamWorkflow createSafetyAction(TransactionReadable tx, WordUpdateChange updateChange, IAtsTeamWorkflow teamWf, ArtifactReadable userArt) { IAtsTeamWorkflow teamWorkflow = null; try { IAtsActionableItem ai = atsServer.getConfig().getSoleByUuid(AtsArtifactToken.SafetyActionableItem.getUuid(), IAtsActionableItem.class); if (ai == null) { throw new OseeCoreException("Safety Actionable Item not configured"); } IAtsTeamDefinition teamDef = atsServer.getConfig().getSoleByUuid(AtsArtifactToken.SafetyTeamDefinition.getUuid(), IAtsTeamDefinition.class); if (teamDef == null) { throw new OseeCoreException("Safety Team Definition not configured"); } IAtsUser createdBy = AtsCoreUsers.SYSTEM_USER; IAtsChangeSet changes = atsServer.getStoreService().createAtsChangeSet("Create System Safety Workflow", atsServer.getUserService().getUserById(userArt.getSoleAttributeAsString(CoreAttributeTypes.UserId))); teamWorkflow = atsServer.getActionFactory().createTeamWorkflow(atsServer.getActionFactory().getAction(teamWf), teamDef, java.util.Collections.singleton(ai), null, changes, new Date(), createdBy, new NewActionAdapter() { @Override public void teamCreated(IAtsAction action, IAtsTeamWorkflow teamWf, IAtsChangeSet changes) throws OseeCoreException { changes.setSoleAttributeValue(teamWf, AtsAttributeTypes.Description, "Review System Safety Changes for the associated RPCR to Complete the Workflow"); } }); changes.setSoleAttributeValue(teamWorkflow, CoreAttributeTypes.Name, "Safety Workflow for " + teamWf.getAtsId()); changes.execute(); } catch (Exception ex) { logger.error(ex, "WordUpdateData Safety Action creation"); } return teamWorkflow; }