-
Notifications
You must be signed in to change notification settings - Fork 86
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
HBW-61 Add support for Camunda #149
Conversation
def process_instances(entity_code, entity_class) | ||
response = api.post( | ||
'query/process-instances', variables: [ | ||
'query/process-instances', variables: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use 2 spaces for 1 lvl
end | ||
def get_variables(user, entity_class, entity_code) | ||
{ | ||
:initiator => {value: user.id, type: :string}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
|
||
def process_instances(entity_code, entity_class) | ||
response = api.post( | ||
'/rest/process-instance', variables: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces.
|
||
def get_variables(user, entity_class, entity_code) | ||
[ | ||
{ name: :initiator, value: user.id, type: :string }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces
hbw/app/models/hbw/common/adapter.rb
Outdated
|
||
def users_lookup(pattern) | ||
d_pattern = pattern.mb_chars.downcase.to_s | ||
users.select do |user| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line before select.
hbw/app/models/hbw/common/adapter.rb
Outdated
# TODO: Think of suspended process instances | ||
def bp_running?(entity_code, entity_class, current_user_identifier) | ||
!process_instances(entity_code, entity_class).empty? || | ||
!task_list_response(current_user_identifier, entity_code, entity_class, 1000, true).empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces
hbw/app/models/hbw/form.rb
Outdated
if activiti? | ||
deployment = ::HBW::Deployment.fetch(process_definition) | ||
resource = deployment.resource(task.form_key) | ||
if resource.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise ..... if resource.nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I force everyone to use
if condition?
raise Exception
end
hbw/app/models/hbw/task.rb
Outdated
size: size)) | ||
if activiti? | ||
wrap( | ||
do_request(:post, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces
hbw/app/models/hbw/task.rb
Outdated
active: true, | ||
includeProcessVariables: true, | ||
processInstanceVariables: [ | ||
name: HBW::Widget.config.fetch(entity_class)[:entity_code_key], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces
hbw/app/models/hbw/task.rb
Outdated
id = task.fetch('processDefinitionId') | ||
|
||
variables = do_request(:get, "/rest/process-instance/#{task.fetch('processInstanceId')}/variables") | ||
task.merge!('variables' => variables.map { |k, v| v.merge({'name' => k})}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hash-rocket!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
2.5.1 :001 > {'test': 1}
=> {:test=>1}
2.5.1 :002 > {'test' => 1}
=> {"test"=>1}
9ec88ac
to
3c2f1d1
Compare
Updated |
Updated |
hbw/app/models/hbw/task.rb
Outdated
id = task.fetch('processDefinitionId') | ||
|
||
variables = do_request(:get, "/rest/process-instance/#{task.fetch('processInstanceId')}/variables") | ||
task.merge!('variables' => variables.map { |k, v| v.merge({'name' => k})}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variables.map { |k, v| v.merge({ 'name' => k }) }
Updated |
Anything else? |
No description provided.