Skip to content

CONV013 flags a deliberate ThrowException call and java action calls in a loop, where Rollback is the only valid handling #1689

Open

Description

@GlennCorvers

What happens

Lint rule CONV013 ("uses 'Rollback' error handling instead of Custom") fires on two patterns where Rollback is the right or the only choice:

  1. A call to an always-throwing action such as CommunityCommons.ThrowException, used to make the calling flow roll back (MDL refuses raise error in the main flow, MDL084/CE0710). With a custom handler beside the call, another rule (a flow-layout rule) flags the handler; without one, CONV013 fires.
  2. A java action call inside a loop: Mendix allows only Rollback there (CE0644), and CONV013 still fires.

So one rule always fires for a deliberate pattern, and the app needs a baseline entry for it.

Expected

CONV013 does not flag (1) an always-throwing action and (2) a java action call inside a loop. If that cannot be detected, an in-model way to accept a finding for one element (an annotation or a per-element ignore) would also solve it; today mxcli lint only has rule-wide config.

Reproduction (sketch)

create microflow M.SUB_Fail () returns Boolean as $ok
begin
  log error node 'M' 'commit refused';
  call java action CommunityCommons.ThrowException (Message = 'refused');
  return false;
end;

mxcli lint reports CONV013 on the call. Same for any java action call inside a loop.

Related: #1202 (closed, CONV013 reading an empty field).

Environment

mxcli 0.28.0, Studio Pro 11.12.4, Windows 11. Found by the AppGen tooling (Ciphix) on a test app.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions