Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jaboto opened this issue Jul 24, 2020 · 0 comments

Comments

@jaboto
Copy link
Collaborator

jaboto commented Jul 24, 2020

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() );
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant