Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 44
Registered: ‎11-23-2015

Redirecting between Workflows

We have a workflow A, in which you can select an object (of Feature Schacht or Haltung) in a FormTable.

Now we want to edit this selected object in workflow B, so we want to redirect to workflow B with the selected object of the feature.

 

Problem:

Workflow B is loaded, but with an empty FormTable (-> without our selected object).

If we terminate this redirected workflow B and open workflow B directly via the button in the tab (without changing any features, objects etc),

workflow B shows our selected object as requested.

 

What is missing that the redirected workflow B directly shows the selected object?

 

 

Workflow A:

<FormAction name="SANEdit"  action="SCRIPT[IG.AbwasserEdit({Row.GID}, {Row.Typ})]"                                                                     
 type="row"  label="Bearbeiten" image="ig-icon-edit" visible="form"/>

IG.AbwasserEdit = function(id, typ) {

               if(typ =='Schacht') {
                               IG.reloadFeatures('Schacht_SQL');
                               IG.setActiveFeature('Schacht_SQL');  
                } else if (typ=='Haltung'){
                               IG.reloadFeatures('Haltung_SQL');
                               IG.setActiveFeature('Haltung_SQL');  
                } else {
                               /* should never happen */
                               IG.notify('Der Typ ist unbekannt', {fadeOut: true, delay:7000}).show();              
                               return;                 
                }
                IG.clearSelectedElements();                                                                    
                IG.setSelectedElements(id);
                IG.redirectToWorkflowNode({controller:'Form',nodeid: '1'});
}

 

We also tried to set the ID as additional URL-param:

IG.redirectToWorkflowNode({controller:'Form',nodeid: '1', urlParams:{GID:id}});

-> but nothing changed

 

Workflow B (nodeid: 1): we use: {SESSION.Map.MapSelection}:

<FormTable name="ListeHaltungen" label="Liste der selektierten Haltungen" idfield="GID" datatype="string" persisted="false" selectionmode="multiple" rowcount="8"
                lov="SQL[select AH.GID, AH.Bezeichnung, AH.Kanalart, AH.Baujahr, AH.Laenge, AH.Erfassungszeit, Status                                                                 
                 ...                                                                                                                        
                                                                                                              
                 FROM
                                                                                                              
                                               (Select H.GID, H.Bezeichnung, H.Kanalart, H.Baujahr, H.Laenge, A.Status, A.Erfassungszeit, A.Typ from Haltung H
                                                                                                                             
                                               LEFT JOIN AbwasserKontrolle A on H.GID=A.GID
                                                                                                                             
                                               WHERE H.GID in ({SESSION.Map.MapSelection})
                                                                                                                             
                                               AND (A.Typ='Haltung' OR A.Typ is NULL)
                                                                                                              
                                               ) AS AH
                                                                                                              
                               ...]" >
GBI Kommunale Infrastruktur GmbH & Co. KG | Germany
Contributor
Posts: 28
Registered: ‎11-04-2015

Re: Redirecting between Workflows

Contributor
Posts: 44
Registered: ‎11-23-2015

Re: Redirecting between Workflows

I have also looked up this old post from the blog but I don't think this will help us. For me it just describes a workaround to get to Workflow B if you can't use the "standard" way. 

 

We can set the url parameters with the

IG.redirectToWorkflowNode({controller:'Form',nodeid: '1', urlParams:{GID:id}});

but it doesn't work and it seems that there is something missing.

 

If we check the paramteres with firebug we can see, that the session ID and GID are stored inside the url.

GBI Kommunale Infrastruktur GmbH & Co. KG | Germany
Staff
Posts: 951
Registered: ‎10-19-2015

Re: Redirecting between Workflows

Hi Christopher,

 

please check if in your GMSC session you have got a variable TABLENAME.PK while redirecting to the new workflow (becuase you are changing the currently active feature to a new one). If not, you can create it using a session trigger and calling the trigger in your custom action. Something like:

 

<WorkflowTrigger name="StoreBEGridInSession" method="action" type="SessionTrigger">
        <Param name="Key" value="BeGridIDs" />
        <Param name="Value" value="{REQUESTCONTEXT.currentGridItems}" />
</WorkflowTrigger>

called as (when it's done I would continue with the rest...)

 

IG.trigger({triggerNames:['StoreBEGridInSession']}).done( ... );

 

Are workflow A and workflow B different workflows or just different workflow nodes? Navigating between different workflows would need additional parameters and I would use IG.redirect() action. If everything is in the same workflow you can even use the IG.navigate() aciton.

 

HTH,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Highlighted
New Contributor
Posts: 4
Registered: ‎11-04-2015

Re: Redirecting between Workflows

[ Edited ]

Christopher,

 

please use your urlParams like this and you will win  Smiley Happy

 

 

 

IG.redirectToWorkflowNode({controller:'Form',nodeid: '1', urlParams:{id:id}});

 

 

Every form always interprets the urlParam "id" automatically before loading the whole form. So your formfields will be filled automatically by the controller.

 

 

If you use your ID Field name like "GID", you will need a defaultvalue for every formfield like this .... :

 

select GID from your table where GID ={REQUESTCONTEXT.GID}

 

Contributor
Posts: 44
Registered: ‎11-23-2015

Re: Redirecting between Workflows

[ Edited ]

@sturcato@

Thank you for the tip about the IG.navigate() action. My two workflows are only different nodes, so you were right about that and i can use the IG.navigate() action instead of the IG.redirect(). I tried this, but it didn't solve the problem.

@robert.hobsch:

Thank you for the hint. I didn't know that id is always the primary key independent from the spelling. I also adjusted my workflow to this, but the outcome was the same like before.

 

Our problem is, that we need the {SESSION.Map.MapSelection} for our FormTable in Workflow B. If we navigate from A to B, the {SESSION.Map.MapSelection} is unknown. If we start workflow B again (after we navigate from A to B and closed it), the {SESSION.Map.MapSelection} is knwon/available.

 

We tested this with a Button in worklofw B:

<FormAction name="TestButton" label="TestButton" action="SCRIPT[
					IG.getMapSelection({SESSION.Map.MapSelection})]" />	

In our custom script an alert shows the system string of {SESSION.Map.MapSelection}. Just to check for us, if there is data stored in {SESSION.Map.MapSelection} and we have access to it.

 

I also set up an time delay to exclude an error due to any time problems...

 

So how can i get access to the {SESSION.Map.MapSelection} via IG.navigate()?

GBI Kommunale Infrastruktur GmbH & Co. KG | Germany
Polls
Please register to vote
Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.