Skip to content
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

Merged
merged 1 commit into from
Sep 5, 2018
Merged

HBW-61 Add support for Camunda #149

merged 1 commit into from
Sep 5, 2018

Conversation

sugarfree1
Copy link
Contributor

No description provided.

def process_instances(entity_code, entity_class)
response = api.post(
'query/process-instances', variables: [
'query/process-instances', variables: [
Copy link
Member

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},
Copy link
Member

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: [
Copy link
Member

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 },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces


def users_lookup(pattern)
d_pattern = pattern.mb_chars.downcase.to_s
users.select do |user|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line before select.

# 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?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces

if activiti?
deployment = ::HBW::Deployment.fetch(process_definition)
resource = deployment.resource(task.form_key)
if resource.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise ..... if resource.nil?

Copy link
Contributor Author

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

size: size))
if activiti?
wrap(
do_request(:post,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces

active: true,
includeProcessVariables: true,
processInstanceVariables: [
name: HBW::Widget.config.fetch(entity_class)[:entity_code_key],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces

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})})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hash-rocket!?

Copy link
Contributor Author

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}

@sugarfree1 sugarfree1 force-pushed the HBW-61 branch 2 times, most recently from 9ec88ac to 3c2f1d1 Compare September 4, 2018 08:01
@sugarfree1
Copy link
Contributor Author

Updated

@sugarfree1
Copy link
Contributor Author

Updated

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})})
Copy link
Member

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 }) }

@sugarfree1
Copy link
Contributor Author

Updated

@sugarfree1
Copy link
Contributor Author

Anything else?

@sugarfree1 sugarfree1 merged commit 4926a84 into master Sep 5, 2018
@sugarfree1 sugarfree1 deleted the HBW-61 branch September 5, 2018 12:56
@sugarfree1 sugarfree1 restored the HBW-61 branch November 9, 2018 15:56
@sugarfree1 sugarfree1 deleted the HBW-61 branch November 9, 2018 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants