Skip to main content
Solved

Workflow Enrichment patching other entity

  • January 27, 2025
  • 7 replies
  • 121 views

REOGIRARD
Do Gooder (Customer)
Forum|alt.badge.img+5

 Hello

I’m trying to create an enrichment process workflow which triggered when calling the following projection action on the Operation Tab of the Routing page : 

RoutingHandling.svc/CreateStandardOperation

When I add a new Standard Operation on a Routing, I want to update a custom attribute of the newly created RoutingOperation entity.

As we can add a standard operation by copy or by reference, I need in both cases to get the standard operation to save it in the custom attribute “Orig_Std_Operation”, so in case we don’t have reference anymore, we keep the original one stored for further consultations and business operations.

So in case we add the standard operation by Copy, there is no link to the standard operation, so I can’t update the field of the RoutingOperation entity with an event action, this is why i need a workflow event, to catch the Client value.

I’m trying to achieve this since hours without any success.

Best answer by pdollk

Hi ​@REOGIRARD ,

As I understand, some aspects of your workflow need to be changed. I created a workflow for a similar scenario based on yours, which I hope will help you.

Use a script task to arrange the data. After the gateway, if the status value is 'Copy,' it should route to the IFS failure end event. If the status value is not 'Copy' (i.e., it is 'Reference'), it should route through the normal end event.

 

Script task code

Condition check

In the execution, I debugged the workflow and provided a value suitable for the scenario in debug mode for now.

Provide the value for OriginalStatus variable


 After the script task, values are assign as expected.

We can verify the routing path followed using the eye icon. Currently, it is in the IFS failure event path.

 

Check with the OriginalStatus value 'Reference'.

Now the eye icon is on the normal end event path.

This may not be the exact answer, but I hope it can give you some idea.

View original
Did this topic help you find an answer to your question?

7 replies

Forum|alt.badge.img+2
  • Do Gooder (Employee)
  • 5 replies
  • January 28, 2025

Hi ​@REOGIRARD ,

Can you share the workflow details you created for this?


REOGIRARD
Do Gooder (Customer)
Forum|alt.badge.img+5
  • Author
  • Do Gooder (Customer)
  • 10 replies
  • January 28, 2025

Hello ​@pdollk ,
At some point, I tried another kind of workflow, so I did not keep what I tried in my first description.
It would have been very enriching to find a solution to my initial problem, but not being able to spend an indefinite amount of time on a feature, I had to change my approach.
I’m now using a validation workflow to block the standard operation insertion by copy, as insertion by reference will provide data in the “StandardOperationName” field of the RoutingOperation row, which I can then use in other events after the creation of the row.
This validation workflow is what exists in our IFS V8 with the std operation origin feature, developed by IFS for us.
I’m still having issue because the validation doesn’t success even with the correct data.


I made a really basic diagram :



Here is details of the passed by reference flow :
 

(in script section, I tried “ execute.getVariable(“CopyReference”) == “Reference”; “ and it doesn’t work as well)

I created then an event on the creation of a new row on RoutingOperation LU (ROUTING_OPERATION_TAB)


I added an event action of type “Validation” , with timing set to “After”.


It’s blocking the validation of the std operation assistant even when CopyReference == “Reference”, which i don’t want.

I activated the watch debug and here is the data catch in the workflow, copyreference exists and has “Reference” value
 


Thank you


Forum|alt.badge.img+2
  • Do Gooder (Employee)
  • 5 replies
  • Answer
  • January 28, 2025

Hi ​@REOGIRARD ,

As I understand, some aspects of your workflow need to be changed. I created a workflow for a similar scenario based on yours, which I hope will help you.

Use a script task to arrange the data. After the gateway, if the status value is 'Copy,' it should route to the IFS failure end event. If the status value is not 'Copy' (i.e., it is 'Reference'), it should route through the normal end event.

 

Script task code

Condition check

In the execution, I debugged the workflow and provided a value suitable for the scenario in debug mode for now.

Provide the value for OriginalStatus variable


 After the script task, values are assign as expected.

We can verify the routing path followed using the eye icon. Currently, it is in the IFS failure event path.

 

Check with the OriginalStatus value 'Reference'.

Now the eye icon is on the normal end event path.

This may not be the exact answer, but I hope it can give you some idea.


REOGIRARD
Do Gooder (Customer)
Forum|alt.badge.img+5
  • Author
  • Do Gooder (Customer)
  • 10 replies
  • January 28, 2025

Hello ​@pdollk 

Thank you for your fast answer, you solved my issue.
The point I don’t understand, is why the data from the client is not exploitable directly in the condition check and needs to be “arranged”.


Forum|alt.badge.img+2
  • Do Gooder (Employee)
  • 5 replies
  • January 28, 2025

Hi ​@REOGIRARD ,

Actually, you don't always need to rearrange the data from the client. It totally depends on the way you create the workflow. In the previous example, I elaborated on the scenario, but you can directly use the input from the client.

Here's an updated example:

I updated the previous workflow by adding a READ task to fetch data from the RegulatoryBodySet entity in the RegulatoryBodyHandling projection where RegulatoryBodyCode is 'R1'. I retrieved the RegulatoryBodyDesc value, and if it is equal to 'Copy,' the workflow will route to the IFS failure end event.

In the RegulatoryBodySet, there is a record where RegulatoryBodyCode is 'R1' and the RegulatoryBodyDesc value is 'Copy'.

After debugging the workflow, I retrieved 'Copy' as the value of RegulatoryBodyDesc, and it routed to the IFS failure end event path.

 


REOGIRARD
Do Gooder (Customer)
Forum|alt.badge.img+5
  • Author
  • Do Gooder (Customer)
  • 10 replies
  • February 3, 2025

Hi ​@pdollk thank you for additional information.
I’m still having trouble with the initial issue because the “adding standard operation” to a shop order (shop order operations) doesn’t work the same way as adding a standard operation to a routing (routing operations)
I tried to use your method from the last exemple, I read the standard operation from informations I get when I add this one to the shop order, but I can’t get the rowkey which is needed to create the reference on my custom field (rowkey & name of the standard operation). In fact, the rowkey I’m fetching from the debugger is the one from the event, and not from the resource i’m reading.

On the screen below, you can see the “read standard projection activity” which i except to get the rowkey to then update the standard operation entity to add data into custom fields.
 

 


Forum|alt.badge.img+2
  • Do Gooder (Employee)
  • 5 replies
  • February 3, 2025

Hi ​@REOGIRARD ,

As I understand, you cannot retrieve the ROWKEY in the workflow when the event action occurs. Ensure that the new value of ROWKEY is included when creating the event. In workflows, only new values from the event action are considered.

 

 

When you start watch the workflow and see the observation, you will be able to see the attributes coming inside the WF when the event or projection action is triggered. This will help you confirm whether ROWKEY is being passed as input to the workflow.

Hope this helps you.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings