question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting Variables from graphql

See original GitHub issue

Sirs I have tried searching in the forum for my kinda error. Sorry if this is a repeat.

I’m using 7.0.0.SR1 Runtime Bundle. With latest activiti/activiti-cloud-notifications-graphql:7.1.58.

Here is my query:

query {
  ProcessInstances(where: {
    OR: {
      status: { IN: RUNNING }
    }
  }) {
    select {
      id
      status
      variables{
        name
        value
	  }
    }
  }
}

I managed to get:

{
    "data": {
        "ProcessInstances": {
            "select": [
                {
                    "id": "750f8cf1-61e1-11e9-84b3-0242ac130002",
                    "status": "RUNNING",
                    "variables": []
                },
                {
                    "id": "818996f2-6342-11e9-89c8-0242ac13001e",
                    "status": "RUNNING",
                    "variables": []
                },
                {
                    "id": "8b2c0563-6342-11e9-89c8-0242ac13001e",
                    "status": "RUNNING",
                    "variables": []
                }
            ]
        }
    }
}

How can I get the variables values and names from graphql? Using the JPA query service REST API, I managed to get all of them. But I have to iterate per process instance id in order to get all the variables.

Regards

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
alaksmanacommented, Apr 24, 2019

@igdianov Thanks you very much! It works now! Thank you for your patience!

{
    "data": {
        "ProcessInstances": {
            "select": [
                {
                    "id": "c41b8b54-665a-11e9-bf61-0242ac13000c",
                    "status": "RUNNING",
                    "variables": [
                        {
                            "name": "logsource",
                            "value": "com.mycompany.rnd.bali.datamyapplicationservice.service.DataService [1207]"
                        },
                        {
                            "name": "database",
                            "value": "myapplication_lbu"
                        },
                        {
                            "name": "formcode",
                            "value": "F0020"
                        },
                        {
                            "name": "databefore",
                            "value": {
                                "ymd": "2019-03-21T00:00:00Z",
                                "ass_lblty_off_flg": "3",
                                "off_cd": "441",
                                "gl_acct": "1",
                                "br_cd": "100",
                                "bi_br_cd": "032",
                                "bi_acct_tp": "015",
                                "bi_curr_cd": "AED",
                                "prev_mth_bal": 1,
                                "mtd_dbt_amt": 1,
                                "mtd_cdt_amt": 1,
                                "mtd_oth_amt": 1,
                                "bal": 1,
                                "int_rt": 100,
                                "adj_flag": "M",
                                "acc_no": "1",
                                "pkid": 15041,
                                "valid_flg": "O"
                            }
                        },
                        {
                            "name": "querytype",
                            "value": "update"
                        },
                        {
                            "name": "logmessage",
                            "value": "Successfull PUT /myapplication/oracle/update/F0020/S/myapplication_lbu/tbls_interoffice_common_table/15041/2-464-148-120"
                        },
                        {
                            "name": "approvermailstatus0",
                            "value": "{\"mailok\":true,\"message\":\"org.springframework.mail.javamail.SmartMimeMessage@1fd04275\"}"
                        },
                        {
                            "name": "name",
                            "value": "jobname"
                        },
                        {
                            "name": "dataafter",
                            "value": {
                                "bi_br_cd": "032",
                                "off_cd": "441",
                                "bi_acct_tp": "015",
                                "bi_curr_cd": "AED",
                                "int_rt": 100,
                                "prev_mth_bal": 15,
                                "mtd_dbt_amt": 1,
                                "mtd_cdt_amt": 1,
                                "mtd_oth_amt": 1,
                                "bal": 1
                            }
                        },
                        {
                            "name": "approverlist",
                            "value": "{ \"user_id\" : \"fb59f2a0-9bb8-42c0-a2ee-18743f785da7\", \"user_name\" : \"mukhtarharis\", \"user_firstname\" : \"Mukhtar\", \"user_lastname\" : \"Haris\", \"user_email\" : \"mukhtar.haris@mycompanycorp.com\", \"user_approvaltype\" : \"singleapprover\", \"approval-list\" : [{ \"user_approve_id\" : \"16033377-5d7e-44b2-b87b-4ac70617ff42\", \"user_approve_name\" : \"idamluqmana\", \"user_approve_firstname\" : \"Idam\", \"user_approve_lastname\" : \"Luqmana\", \"user_approve_email\" : \"idam.luqmana@mycompanycorp.com\" }], \"branch-list\" : [] }"
                        },
                        {
                            "name": "tablename",
                            "value": "tbls_interoffice_common_table"
                        },
                        {
                            "name": "type",
                            "value": "approval"
                        },
                        {
                            "name": "remotehost",
                            "value": "172.19.0.4"
                        },
                        {
                            "name": "useragent",
                            "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
                        },
                        {
                            "name": "username",
                            "value": "mukhtarharis"
                        },
                        {
                            "name": "fileimportlink",
                            "value": "na"
                        },
                        {
                            "name": "requestor",
                            "value": "fb59f2a0-9bb8-42c0-a2ee-18743f785da7"
                        },
                        {
                            "name": "moduleid",
                            "value": "LBU"
                        },
                        {
                            "name": "approvaltype",
                            "value": "singleapprover"
                        },
                        {
                            "name": "requestorinfo",
                            "value": "{ \"user_id\" : \"fb59f2a0-9bb8-42c0-a2ee-18743f785da7\", \"user_name\" : \"mukhtarharis\", \"user_firstname\" : \"Mukhtar\", \"user_lastname\" : \"Haris\", \"user_email\" : \"mukhtar.haris@mycompanycorp.com\" }"
                        },
                        {
                            "name": "querytoexecute",
                            "value": "update tbls_interoffice_common_table set bi_br_cd='032' , off_cd='441' , bi_acct_tp='015' , bi_curr_cd='AED' , int_rt=100 , prev_mth_bal=15 , mtd_dbt_amt=1 , mtd_cdt_amt=1 , mtd_oth_amt=1 , bal=1 where pkid=15041"
                        },
                        {
                            "name": "formname",
                            "value": "Form-20"
                        }
                    ]
                }
            ]
        }
    }
}
0reactions
igdianovcommented, Apr 23, 2019

@alaksmana Ok, I have looked at your Docker Compose and spotted a few things that need correction:

  1. Make sure that you use 7.0.0.SR1 tag for Query, Audit and Notifications Graphq Docker images. The tags should be consistent with activiti-cloud-dependencies version 7.0.0.SR1 used in Rb.

  2. In activiti-cloud-notifications-graphql use the following configuration:

   environment:
      - SPRING_JPA_GENERATE_DDL=false
      - SPRING_JPA_HIBERNATE_DDL_AUTO=none
  1. After making changes, clean you stack docker-compose down, remove all containers and prune all data volumes with docker volume prune and docker system prune.

  2. Start everything with docker-compose up and test again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Queries and Mutations - GraphQL
Instead, GraphQL has a first-class way to factor dynamic values out of the query, and pass them as a separate dictionary. These values...
Read more >
GraphQL Variables - Dgraph
Variables simplify GraphQL queries and mutations by letting you pass data separately. A GraphQL request can be split into two sections: one for...
Read more >
GraphQL variables in simple terms - LogRocket Blog
In GraphQL, you can use variables to reuse the same query/mutations written by the client, with different arguments. To get started, let's look ......
Read more >
GraphQL query best practices
Use GraphQL variables to provide arguments ... The first query uses a variable ( $dogId ) for the value of the dog field's...
Read more >
GraphQL Variables - A Practical Guide to ... - Educative.io
Essentially, variables can be used to create dynamic queries. Following the best practices in GraphQL, we don't need manual string interpolation to structure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found