Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-10825

Add creation time to process instances, external tasks (possibly other objects as well)

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: L3 - Default L3 - Default
    • None
    • None
    • None

      User tasks have a "created at" timestamp.
      I'm wondering why this is missing on other objects, most notably external tasks and process instances.

      You can access the data from the history, but it would be more efficient to just have it on the object itself.

        This is the controller panel for Smart Panels app

            [CAM-10825] Add creation time to process instances, external tasks (possibly other objects as well)

            Sven Wilkens added a comment -

            For external tasks I have a hacky workaround. I get the lock time by requesting the "lockExpirationTime" and than substract the lock time from the external task client. A lock time or create time without workaround would be awesome.

            Sven Wilkens added a comment - For external tasks I have a hacky workaround. I get the lock time by requesting the "lockExpirationTime" and than substract the lock time from the external task client. A lock time or create time without workaround would be awesome.

            Simon Hanna added a comment -

            That really is a hack, that results in wrong information in many cases. It only works if the task client locks it right after creation and only until that client finishes processing it.

            Simon Hanna added a comment - That really is a hack, that results in wrong information in many cases. It only works if the task client locks it right after creation and only until that client finishes processing it.

            Sven Wilkens added a comment -

            Sure to get the create time it doesn't work like that. However if you only want to get the lock time for the current task in your external task client code it works quite well, because the "lockExpirationTime" is calculated when the "fetchAndLock" happens. fetchAndLockTime = lockExpirationTime - externalTaskLockDuration

            Sven Wilkens added a comment - Sure to get the create time it doesn't work like that. However if you only want to get the lock time for the current task in your external task client code it works quite well, because the "lockExpirationTime" is calculated when the "fetchAndLock" happens. fetchAndLockTime = lockExpirationTime - externalTaskLockDuration

            Hi simon.hanna,

            Thank you for the feature request. Adding a created_at column for runtime Process Instances/Executions and External Tasks would lead to duplicating data since, as you say, it's already present in the historic tables.

            Can you provide more information on the use-case, and what is the gain of adding this information in the runtime table, or how much is the current overhead when querying the historic data?

            Best,
            Nikola

            Nikola Koevski added a comment - Hi simon.hanna , Thank you for the feature request. Adding a created_at column for runtime Process Instances/Executions and External Tasks would lead to duplicating data since, as you say, it's already present in the historic tables. Can you provide more information on the use-case, and what is the gain of adding this information in the runtime table, or how much is the current overhead when querying the historic data? Best, Nikola

            Simon Hanna added a comment -

            For process instances our main use case is to retrieve a list of active process instances sorted by creation time.
            For this we could theoretically use the history, but the history space is much larger and there is no index on start_time there.
            Further the history is not guaranteed to be present (if people choose to omit it from being created in the first case)
            We can work around it, but we do have certain process definitions where we intentionally do not create history.

            Everything is more complicated with external tasks.

            "act_hi_ext_task_log_pkey" PRIMARY KEY, btree (id_)
            "act_hi_ext_task_log_proc_def_key" btree (proc_def_key_)
            "act_hi_ext_task_log_procdef" btree (proc_def_id_)
            "act_hi_ext_task_log_procinst" btree (proc_inst_id_)
            "act_hi_ext_task_log_rm_time" btree (removal_time_)
            "act_hi_ext_task_log_root_pi" btree (root_proc_inst_id_)
            "act_hi_ext_task_log_tenant_id" btree (tenant_id_)
            "act_idx_hi_exttasklog_errordet" btree (error_details_id_)

            We can't efficiently retrieve a single task, becuase there is no index on the task id.
            We can't get a list of active tasks with creation date because they are stored in different log entries. We would have to get all start and end events and manually find out if a task has a start log entry but no end log entry.

            Having the timestamps on the active instances (the ones we need to operate on) would make life much easier for us (let us actually implement features...)

            Simon Hanna added a comment - For process instances our main use case is to retrieve a list of active process instances sorted by creation time. For this we could theoretically use the history, but the history space is much larger and there is no index on start_time there. Further the history is not guaranteed to be present (if people choose to omit it from being created in the first case) We can work around it, but we do have certain process definitions where we intentionally do not create history. Everything is more complicated with external tasks. "act_hi_ext_task_log_pkey" PRIMARY KEY, btree (id_) "act_hi_ext_task_log_proc_def_key" btree (proc_def_key_) "act_hi_ext_task_log_procdef" btree (proc_def_id_) "act_hi_ext_task_log_procinst" btree (proc_inst_id_) "act_hi_ext_task_log_rm_time" btree (removal_time_) "act_hi_ext_task_log_root_pi" btree (root_proc_inst_id_) "act_hi_ext_task_log_tenant_id" btree (tenant_id_) "act_idx_hi_exttasklog_errordet" btree (error_details_id_) We can't efficiently retrieve a single task, becuase there is no index on the task id. We can't get a list of active tasks with creation date because they are stored in different log entries. We would have to get all start and end events and manually find out if a task has a start log entry but no end log entry. Having the timestamps on the active instances (the ones we need to operate on) would make life much easier for us (let us actually implement features...)

            Hi simon.hanna,

            Thank you for the nice explanation. I understand the use-case and requirement, so I will forward it for decision making.

            Best,
            Nikola

            Nikola Koevski added a comment - Hi simon.hanna , Thank you for the nice explanation. I understand the use-case and requirement, so I will forward it for decision making. Best, Nikola

            Hello simon.hanna,

            We have discussed this feature request in our product management and agree that this would be a nice addition to the runtime APIs. Would you be interested to make a contribution?

            Best regards,
            Thorben

            Thorben Lindhauer added a comment - Hello simon.hanna , We have discussed this feature request in our product management and agree that this would be a nice addition to the runtime APIs. Would you be interested to make a contribution? Best regards, Thorben

            This ticket was migrated to github: https://github.com/camunda/camunda-bpm-platform/issues/2260. Please use this link for any future references and continue any discussion there.

            Thorben Lindhauer added a comment - This ticket was migrated to github: https://github.com/camunda/camunda-bpm-platform/issues/2260 . Please use this link for any future references and continue any discussion there.

              thorben.lindhauer Thorben Lindhauer
              simon.hanna Simon Hanna
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: