Commit a4c87c52 by jasl

bug fix

parent 97d04074
...@@ -12,6 +12,7 @@ module Workflows ...@@ -12,6 +12,7 @@ module Workflows
# POST /workflows/1/tokens/1/fire # POST /workflows/1/tokens/1/fire
def show def show
@transition_valid = @token.place.output_transition.options.valid?
@form_record = @virtual_model.load(@instance.payload) @form_record = @virtual_model.load(@instance.payload)
end end
...@@ -20,7 +21,10 @@ module Workflows ...@@ -20,7 +21,10 @@ module Workflows
@form_record = @virtual_model.load(@instance.payload) @form_record = @virtual_model.load(@instance.payload)
@form_record.assign_attributes(form_record_params) @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) @instance.update! payload: (@instance.payload || {}).merge(@form_record.serializable_hash)
@token.place.output_transition.fire(@token) @token.place.output_transition.fire(@token)
......
...@@ -12,9 +12,5 @@ class Transitions::ParallelSplit < Transition ...@@ -12,9 +12,5 @@ class Transitions::ParallelSplit < Transition
def auto_forwardable? def auto_forwardable?
true true
end end
def options_configurable?
false
end
end end
end end
<div class="section"> <div class="section">
<div class="container"> <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", <%= render "_form_core/render/form",
form: @form, instance: @form_record, form: @form, instance: @form_record,
options: {scope: :form_record, url: workflow_instance_token_fire_path(@workflow, @instance, @token), local: true} %> 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