Skip to content

Catch exceptions raised by the RuleEngineExecution in different evaluations so it is easier to trace the problem with the Program Rules #52

@jaboto

Description

@jaboto

In the code:

Could be better to have something like:

            try
            {
                if ( Boolean.valueOf( process( rule.condition() ) ) )
                {

                    for ( RuleAction action : rule.actions() )
                    {

                        //Check if action is assigning value to calculated variable
                        if ( isAssignToCalculatedValue( action ) )
                        {
                            try {
                                RuleActionAssign ruleActionAssign = (RuleActionAssign) action;
                                updateValueMap(ruleActionAssign.content(), RuleVariableValue.create(process(ruleActionAssign.data()), RuleValueType.TEXT));
                            } catch (Exception e) {
                                e.printStackTrace();
                                log.error( "Exception while assigning value for PR in " + rule.name() + ": " + e.getMessage() );
                            }
                        }
                        else
                        {
                            try {
                                ruleEffects.add(create(action));
                            } catch (Exception e) {
                                e.printStackTrace();
                                log.error( "Exception while applying action for PR in " + rule.name() + ": " + e.getMessage() );
                            }
                        }
                    }
                }
            }
            catch ( Exception e )
            {
                e.printStackTrace();
                log.error( "Exception in " + rule.name() + ": " + e.getMessage() );
            }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions