Commit a4c87c52 by jasl

bug fix

parent 97d04074
......@@ -12,6 +12,7 @@ module Workflows
# POST /workflows/1/tokens/1/fire
def show
@transition_valid = @token.place.output_transition.options.valid?
@form_record = @virtual_model.load(@instance.payload)
end
......@@ -20,7 +21,10 @@ module Workflows
@form_record = @virtual_model.load(@instance.payload)
@form_record.assign_attributes(form_record_params)
if @form_record.valid?
@transition_valid = @token.place.output_transition.options.valid?
if @form_record.valid? && @transition_valid
@instance.update! payload: (@instance.payload || {}).merge(@form_record.serializable_hash)
@token.place.output_transition.fire(@token)
......
......@@ -12,9 +12,5 @@ class Transitions::ParallelSplit < Transition
def auto_forwardable?
true
end
def options_configurable?
false
end
end
end
<div class="section">
<div class="container">
<% unless @transition_valid %>
<div class="notification is-danger">
The transition are not configure properly,
please <%= link_to "repair it", edit_workflow_transition_options_path(@workflow, @token.place.output_transition) %>.
</div>
<% end %>
<%= render "_form_core/render/form",
form: @form, instance: @form_record,
options: {scope: :form_record, url: workflow_instance_token_fire_path(@workflow, @instance, @token), local: true} %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment