In order to do this you will have to save this in a special way. If you don’t do something special with a new transaction then your save would just be rollbacked (due to the exception being thrown).
If you don’t set that expression then Flowable would retry by default 3 times (this is configurable in the process engine configuration). When you set the
failedJobRetryTimeCycle then it should use that, so in your case 2 times. After the job has run through all the retries it will go to the dead letter jobs.
Just checked the code if there is no exception message then the retried from
failedJobRetryTimeCycle will always be used. Can you try adding a message to your runtime exception?
Having said all of this if you need to throw a BPMN error after certain number of retries you would need to model this in your process. Instead of throwing a runtime exception you would need to throw one kind of BPMN error, then when that error occurs go back to the service task, after your retry count is done you would need to throw your other BPMN error.
To me right now it seems like the retry count has some business logic into it, and you are trying to use the Flowable Job retries to model that.