FinOps v7.1 Post-Deployment Process

Contents

  1. Clear Keycloak Cache
  2. Roles & Privileges
  3. Upgrading workflows
  4. DU Origin changes - Workflow change
  5. Traceability workflow changes
  6. Auto allocation changes
  7. Installation workflow changes – Auto Allocation Parameter Validation
  8. Check Role Condition Workflow changes – Bug Fix

Clear Keycloak Cache

This step needs to be done only if clones-upgrade container was run for the deployment. To clear the Keycloak cache, follow the steps mentioned below:

  1. Login to Keycloak Master Admin console.

  2. Select any of the Realms and in Realm Settings and go to Cache tab.

  3. Click on all the three Clear buttons (Realm Cache, User Cache and Keys Cache) to clear cache in all realms.

 

Graphical user interface, application
Description automatically generated

Note:

  1. This process is required only if the clones-upgrade program was run as part of deployment.

  2. In case the person who is doing the post-deployment steps are not aware of the deployment procedures completed, this can be executed.

Roles & Privileges

Invoice Extraction requires that the user with offline access (usually sense master) have the following access. Add these roles if they are not available.

Picture 1843358518

User performing the post deployment activities is supposed to have the following roles:

Upgrading workflows

  1. For applying changes to new projects (Golden workflows)

    1. Import the modified workflows from 7.1.1 skill dump to replace existing (if workflows are not customized)

    2. If workflows are customized, make necessary changes to customized workflow referring below details

    3. Publish and mark the two workflows as golden skills

    4. The skills of the new projects created will contain the latest changes

  2. For applying changes to old projects

    1. Modify the existing project specific workflows as per the change log

    2. New micro actions are part of the skill dump and will get automatically imported on importing the golden workflows

    3. Save and publish the modified workflows specifically for every existing projects which are relevant

DU Origin changes - Workflow change

 

Workflow: Invoice_PWF_PushToDUSched

DU rest service requires new parameter “origin” and it has to be set as “invoice_pwf” for the requests from invoice PWF.

Workflow Invoice_PWF_PushToDUSched to be modified to include additional argument and value in in microaction JSON_for_DU (as shown in below image fig.1)

 

The update to be made to golden skill Invoice_PWF_PushToDUSched and to be marked as golden.

Also the same update to be made for relevant project which already exists and to be published.

Picture 1

 

Traceability workflow changes

Workflows Modified:

  1. Invoice_PWF_PushToDUSched

    1. Invoice_PWF_DownloadInvoice

Changes in Invoice_PWF_PushToDUSched workflow

Image1

  1. New microaction added –GetSkillExeDetails (get_project_execution_details_v2) to fetch the workflow_id

    1. Microaction added as the third step in the workflow (after Generate_run_name and before Fetch_du_project_id)

 

Attributes

Value

smartopsPwfUrl

${ get_sp("SMARTOPS_PWF_HOST") }

projectId

${get_sp("clonesParam.projectId")}

sessionId

${get_sp("clonesParam.sessionId")}

organizationId

${ get_sp("clonesParam.organizationId") }

offlineToken

${ get_sp("clonesParam.offlineToken") }

connectTimeout

120

socketTimeout

120

 

  1. The workflow_id is fetched at JSON_for_PWFDB and sent through existing API_to_PWFDB(no change in API_to_PWFDB)

New attributes at JSON_for_PWFDB, this microaction should be placed as per the flow in the image.

Attributes

Value

field9

inbound_workflow_id

value9

${str(eval(skillExeDetails)[0].get("wfExecutionId"))}

 

  1. Flow redesigned, batch creation in PWF now happens before the files are pushed to du for processing. New flow shared in screenshot above (API_to_PWFDB is moved to front as in image) – This is an optional but recommended change to create the record in PWF even DU service call is failed to help traceability.

Changes in Invoice_PWF_DownloadInvoice

Image2

  1. New microaction added –GetSkillExeDetails (get_project_execution_details_v2) to fetch the workflow_id

    1. Microaction added as the first step in the workflow, need to be placed before Generate Report.

Right click on the micro action and mark it as the start.

Attributes

Value

smartopsPwfUrl

${ get_sp("SMARTOPS_PWF_HOST") }

projectId

${get_sp("clonesParam.projectId")}

sessionId

${get_sp("clonesParam.sessionId")}

organizationId

${ get_sp("clonesParam.organizationId") }

offlineToken

${ get_sp("clonesParam.offlineToken") }

connectTimeout

120

socketTimeout

120

  1. The workflow_id is sent as additional parameter of existing GenerateReport API

Replace the API url with ${"http://" + get_sp("SMARTOPS_INVEX_API") + "/download/generatereport/"+invex_project_id+"?outbound_workflow_id="+str(eval(skillExeDetails)[0].get("wfExecutionId"))}

Auto allocation changes

Workflow name = Invoice_PWF_AutoAllocation

  1. For existing projects, workflows to be manually loaded to corresponding project folder with, where workflow name should be modified as with a suffix of _<project_id>. The steps for doing this are as follows.

  2. From lover environment create a project with same name (Just provide name and description) and install

  3. Export this work flow

  4. Import to new environment

  5. Save, publish and promote to golden

Workflow name = CheckRoleCondition

For the step – AddResponseMessage, added a new attribute. This will add the number of pages in the invoice to the response message sent to queue.

Key - number_of_pages

Value - ${str(eval(invoice_details).get("document_details", {}).get("_source", {}).get("page_count", None))}

 

Installation workflow changes – Auto Allocation Parameter Validation

Workflow name = Invoice_PWF_Installation

1. Open skill settings and set the following input parameters.

Inputs

 


‎invex_min_num_of_pages

Default Value <Empty>

invex_max_num_of_pages

Default Value <Empty>

invex_allocation_scheduler_interval

Default Value <Empty>

invex_priority_criteria

Default Value <Empty>

 

2. Make changes as per the flow shown below.

Picture 2130689272

The details of each node in the above workflow is presented below.

 

  1. Step Name: IsAllocScheduled

    Operation: Is Not Empty

    Attributes

     

    value

    invex_allocation_scheduler_interval <FIELD>

  2. Step Name: PWFProjectSuccess

    Operation: PWF Project Status Update

    Attributes

     

    * smartopsPwfUrl

    ${ get_sp("SMARTOPS_PWF_HOST") }

    * smartopsPwfUrl

    ${ get_sp("SMARTOPS_PWF_HOST") }

    * status


    READY

    * projectId

    ${ get_sp("clonesParam.projectId") }

    offlineToken

    ${ get_sp("clonesParam.offlineToken") }

    proxyHost

    ${ get_sp("proxy.host") }

    proxyPort

    ${ get_sp("proxy.port") }

    proxyUsername

    ${get("proxy_username", "")}

    proxyPassword

    ${get("proxy_password", "")}

    organizationId

    ${ get_sp("clonesParam.organizationId") }

    organizationName

    ${ get_sp("clonesParam.organizationName") }

    connectTimeout

    120

    socketTimeout

    120

  3. Step Name: LogSuccess

    Operation: Log.Print

    Attributes

     

    Text

    Project successfully installed

  4. Step Name: IsNotEmptyMinConfig

    Operation: Is Not Empty

    Attributes

     

    Value

    invex_min_num_of_pages <FIELD>

  5. Step Name: IsNotEmptyMaxConfig

    Operation: Is Not Empty

    Attributes

     

    Value

    invex_max_num_of_pages <FIELD>

  6. Step Name: EvaluateIsDigits (After IsNotEmptyMaxConfig -> True)

    Operation: evaluate_expression

    Attributes

     

    expression

    invex_min_num_of_pages.isdigit() and invex_max_num_of_pages.isdigit()

  7. Step Name: EvaluateThresholdConfig (After EvaluateIsDigits -> True)

    Operation: evaluate_expression

    Attributes

     

    expression

    int(invex_min_num_of_pages) < int(invex_max_num_of_pages) and int(invex_max_num_of_pages) > 0 and int(invex_min_num_of_pages) > 0

  8. Step Name: EvaluatePriorityCriteria (After Step EvaluateThresholdConfig -> True)

    Operation: evaluate_expression

    Attributes

     

    expression

    ' ' not in invex_priority_criteria

  9. Step Name: PWFProjectFailure

    Operation: PWF Project Status Update

    Attributes

     

    * smartopsPwfUrl

    ${ get_sp("SMARTOPS_PWF_HOST") }

    * smartopsPwfUrl

    ${ get_sp("SMARTOPS_PWF_HOST") }

    * status


    INSTALL_ERROR

    * projectId

    ${ get_sp("clonesParam.projectId") }

    offlineToken

    ${ get_sp("clonesParam.offlineToken") }

    proxyHost

    ${ get_sp("proxy.host") }

    proxyPort

    ${ get_sp("proxy.port") }

    proxyUsername

    ${get("proxy_username", "")}

    proxyPassword

    ${get("proxy_password", "")}

    organizationId

    ${ get_sp("clonesParam.organizationId") }

    organizationName

    ${ get_sp("clonesParam.organizationName") }

    connectTimeout

    120

    socketTimeout

    120

  10. Step Name: LogFailure

Operation: Log.Print

Attributes

 

Text

Please check auto allocation configuration

 

Use ‘Step Name’ and diagram above to identify the node and its placement. Use ‘Operation’ to identify the microaction to be used.

Once the changes are completed, save & publish the workflow.

Check Role Condition Workflow changes – Bug Fix

Workflow name: Invoice_PWF_CheckRoleCondition

Automation Story: PWFInvoiceExtractionApprovalRoute

Make changes as per the flow shown below.

Highlighted Nodes were added/modified

Picture 135514918

The details of each node in the above workflow is presented below.

  1. Step Name: JSONGetExtractionTime

    Operation: Json value extract v2_2

    Attributes

    sourceJson

    invoice_details <FIELD>

    extractSpec

    $.document_details._source.created_date

    pickFirstElementForArray

    true

     

    Outcome

    extraction_start_time

    value

    returnCode

    returnCode

    errorMessage

    errorMessage

    exception

    exception

  2. Step Name: JSONGetDocumentName

    Operation: Json value extract v2_2

    Attributes

    sourceJson

    invoice_details <FIELD>

    extractSpec

    $.document_details._source.document_name

    pickFirstElementForArray

    true

     

    Outcome

    document_name

    value

    returnCode

    returnCode

    errorMessage

    errorMessage

    exception

    exception

     

  3. Step Name: JSONGetParentDocId

    Operation: Json value extract v2_2

    Attributes

    sourceJson

    invoice_details <FIELD>

    extractSpec

    $.document_details._source[?(@.parent_doc_id)].parent_doc_id

    pickFirstElementForArray

    true

     

    Outcome

    parent_doc_id

    value

    returnCode

    returnCode

    errorMessage

    errorMessage

    exception

    exception

     

  4. Step Name: JSONGetPageCount

    Operation: Json value extract v2_2

    Attributes

    sourceJson

    invoice_details <FIELD>

    extractSpec

    $.document_details._source.page_count

    pickFirstElementForArray

    true

     

    Outcome

    number_of_pages

    value

    returnCode

    returnCode

    errorMessage

    errorMessage

    exception

    exception

     

  5. Step Name: AddResponseMsg

Operation: JSON.Create.V2.2

Attributes

field1

document_id

value1

document_id <FIELD>

field2

status_extraction

value2

event_type <FIELD>

field3

tags

value3

tags <FIELD>

field4

extraction_start_time

value4

extraction_start_time <FIELD>

field5

document_name

value5

document_name <FIELD>

field6

invoice_data

value6

du_result <FIELD>

field7

parent_doc_id

value7

parent_doc_id <FIELD>

field8

number_of_pages

value8

number_of_pages <FIELD>

 

Outcome

responseJson

jsonObject

returnCode

returnCode

errorMessage

errorMessage

exception

exception

Use ‘Step Name’ and diagram above to identify the node and its placement. Use ‘Operation’ to identify the microaction to be used.

Once the changes are completed, save & publish the workflow.

 

Changes to address an issue with RabbitMQ credentials

For new projects:

For old projects:

 

Changes related to vhost configuration

For new projects:

For old projects:

Import the golden workflow from the dump, this will make the new microaction available for modifying old workflows

hostName

${ get_sp("CLONES_QUEUE_HOST") }

port

${ get_sp("clones.queue.port") }

queueName

pwf.invoice.queue

username

${ get_sp("CLONES_QUEUE_USERNAME") }

password

${ get_sp("CLONES_QUEUE_PASSWORD") }

vhost

ie

message

responseJson <field>