cancel
Showing results for 
Search instead for 
Did you mean: 

Boundary Timer Event along with Service Task in SCP-CF Workflow?

karanbahl
Active Participant

Hi Experts,

I have a requirement to auto-complete a task if the User doesn't process the task within stipulated timelines? I want to utilize the Boundary Timer Event for this. Also, if the user doesn't process the task, I want to trigger this event and consequently call a Service Task to update the table with the status. I have implemented the functionality; but my database table is not getting updated with the value.

Here is the screenshot of the flow:

Regards,

Karan

Accepted Solutions (1)

Accepted Solutions (1)

karanbahl
Active Participant
0 Kudos

I changed the format of status to object and it worked. Thanks tobias.breyer and archana.shukla for your help.

former_member751703
Discoverer
0 Kudos

Hi,

Request you to please elaborate a bit on how you changed the format exactly.

Thanks,

RV

Answers (4)

Answers (4)

Archana
Product and Topic Expert
Product and Topic Expert

This should have worked and even I see from the documentation that ${context} should also be ok, but there is another mention in the documentation: "If the request variable contains a primitive JSON type (number or string) or literal (null, true, or false), the service must accept an HTTP body following RFC 8259 instead of the older RFC 4627" - If it it does not help, please raise the ticket

karanbahl
Active Participant
0 Kudos

I tried switching to the V2 OData version as well; considering my service was exposed as V4. However, the same error persists. Will raise an incident for the same; if more tries do not work out soon. Below is the error log I get.

Thanks archana.shukla for your valuable inputs.

The HTTP request to http://service/v2/installation/InstallationDetails('12350')' failed with status code 400 (Bad Request) and response body '<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Bad Request</pre> </body> </html> '.
Archana
Product and Topic Expert
Product and Topic Expert

Hello Karan,

There could be multiple reasons for it. (a) Does your service call really need XSRF token? If not then you do not have that field filled in service task configuration, (b) If your service call needs XSRF token, then you need to ensure that the response of the XSRF URL returns x-csrf-token as one of the header param. (c) Check you destination configuration once? (d) hope you API call does not have any request header params?

karanbahl
Active Participant
0 Kudos

Thanks archana.shukla for the response. I removed the XSRF token value and made it blank.

I am passing : ${context} in the Request Variable and ${context.response2} in the response variable.

This is the code written in the script file before the service task call is performed.

$.context.status = "abc"

However I am getting the below error and autocomplete doesn't work; Any suggestions.

response body '{"error":{"code":"null","message":"Error while deserializing payload. Value for structural type must be an object."}}'

tobias_breyer
Contributor

> response body '{"error":{"code":"null","message":"Error while deserializing payload. Value for structural type must be an object."}}'

I think you are not correctly following the structural requirements of the service that you call. From the wording, I would say it expects an object but receives a primitive type. As Archana outlines below, some JSON based services accept primitive types (those implementing RFC 8259), but many, I guess, need objects (RFC 4627).

When you use ${context.status} and status is just "abc" and similar, then it is the RFC 8259 case. When you use ${context}, it is the RFC 4627 case, as the context is in this case always serialized as an object. It will probably look similar to

{
"status": "abc"
}

On topic of these two cases, a receiving service might complain about that payload when it expects "status" to be an object, like

{

"status": {

"mainstatus": "COMPLETED",

"substatus": "success"

}

}

But you need to check the requirements of the targeted service what is allowed.

karanbahl
Active Participant
0 Kudos

Tobias,

Below payload in Postman is working fine for the PUT method of the service.

{ 
"Status": "Completed"
}

Any suggestions on what could be passed? The service is developed using CAPM and using HDI Instance on CF (Tables on Cloud). The status is being changed using the script task before calling the Service task; as $.context.status = "Completed"

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yeah this is because you cannot use ${context} directly. you need to use some variable inside the context like ${context.node1}

karanbahl
Active Participant
0 Kudos

I actually tried that also before trying this; {context.status}; status being an existing part of context. Should I use a new value instead of an existing property; Will that work?

vbalko-claimate
Active Participant
0 Kudos

And do you have execution of that task in your workflow log in "Monitor instances" application?

If yes - was it performed correctly, or it ends up in error?

If performed correctly, then it is probably error in service itself - try to call it from GW Client and debug it.

karanbahl
Active Participant
0 Kudos

Hi Vladimir,

I am getting the following error:

The XSRF token request to URL 'https://*****' did not return an X-CSRF-Token header in Monitor Workflow Apps.

Regards,

Karan

vbalko-claimate
Active Participant
0 Kudos

It seems to be problem with calling your service, not a workflow itself.

Is that path for XSRF Token correct?

Open Inspect (Ctrl + Shift + I) in chrome and check the network tab if there are request for that token and if token was returned. Also console can give you a clue.

karanbahl
Active Participant
0 Kudos

The service is created on HANA Cloud DB using HDI Service. However; I am unable to fetch the token for it. Getting the below error.

The service is running fine standalone and from postman client.

xsrferror.png; Any idea; what could be the issue?

karanbahl
Active Participant
0 Kudos

Hi archana.shukla , Any suggestions please?

Regards,

Karan