09-28-2012 02:30 PM
10-01-2012 03:12 AM
10-01-2012 09:24 AM
<scriptTask id="changeCurrentUserPassword" name="Alterar atual senha de usuário" scriptFormat="groovy">
<script> <![CDATA[
def userToChangePassword = userService.getUserByLogin(userNameChangePassword);
userToChangePassword.setPassword(newPassword);
userEmailChangePassword = userToChangePassword.getPersonEmail();
try{
userService.updateUser(userToChangePassword);
successOnSendRequest = true;
}catch(Exception e){
successOnSendRequest = false;
exceptionOnChangePassword = e.getMessage();
}
]]> </script>
</scriptTask>
<sequenceFlow sourceRef="changeCurrentUserPassword" targetRef="successOnRequestOrNot"/>
and in my sequenceFlow:
<exclusiveGateway id="successOnRequestOrNot" name="Verificar sucesso ao solicitar nova senha" />
<sequenceFlow sourceRef="successOnRequestOrNot" targetRef="successGateway">
<conditionExpression xsi:type="tFormalExpression">${successOnSendRequest == true}</conditionExpression>
</sequenceFlow>
<sequenceFlow sourceRef="successOnRequestOrNot" targetRef="errorGateway">
<conditionExpression xsi:type="tFormalExpression">${successOnSendRequest == false}</conditionExpression>
</sequenceFlow>
10-03-2012 03:28 AM
Throwing BPMN Errors
As of Activiti 5.9, it is possible to throw BPMN Errors from user code inside Service Tasks or Script Tasks. In order to do this, a special ActivitiException called BpmnError can be thrown in JavaDelegates or scripts and since Activiti 5.10 also in expressions and delegate expressions. The engine will catch this exception and forward it to an appropriate error handler, e.g., a Boundary Error Event or an Error Event Sub-Process.
public class ThrowBpmnErrorDelegate implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
try {
executeBusinessLogic();
} catch (BusinessExeption e) {
throw new BpmnError("BusinessExeptionOccured");
}
}
}
The constructor argument is an error code, which will be used to determine the error handler that is responsible for the error. See Boundary Error Event for information on how to catch a BPMN Error.
This mechanism should be used only for business faults that shall be handled by a Boundary Error Event or Error Event Sub-Process modeled in the process definition. Technical errors should be represented by other exception types and are usually not handled inside a process.
09-02-2015 04:56 AM
09-08-2015 05:52 AM
04-15-2016 06:26 AM
04-20-2016 09:55 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.